父传子 props
----
父组件中的数据传递给子组件
官方文档:通过-Prop-向子组件传递数据
props: ['movies']
props: {
movies: Array
},...props: {
movies: {
type: Array,
default: [],
required: true
}
},
props 的驼峰标识..."article.author">
`,
props: ['article'],
components: {
child: child
}
}
let vm = new Vue...({
el: '#app',
data: {
arts: [
{
title: '01',
img: 'img/01vue.jpg',
content: '01content',
},
{
title:...'02',
img: 'img/01vue.jpg',
content: '02content'
},
]
},
components: {
'art-list': artis
}
})
</script