vue data方法如何获取父组件传过来的props?
export default {
name: 'child',
data() {
return {
getData: null
}
},
props: ['data'],
watch: {
data(newV,oldV) {
// do something
console.log(newV)
this.getData = newV
}
},
}
网友评论