var store = {
props: ['newdd'],
template : `<p style="color:green">我是一个绿色的商店,我的爸爸是herecomponent . {{ newdd.x2 }}</p>`
}
var wcy = {
template: `
<div>
<p style="color:red">
我是定义在构造器外部的局部组件,我的爸爸是app
</p>
<store :newdd="mydatas"></store>
</div>
`,
components: {
'store': store
},
data: function() {
return {
post: {
commentIds: 66
},
mydatas: {
x1: 'xxxxx',
x2: 'ccccccc',
}
}
}
}
var app = new Vue({
el : '#app',
components : {
'wcy' : wcy
}
})
<div id="app">
<wcy></wcy>
</div>