props: {
instance: {
type: String,
required: true
}
},
instanceID的值明明传过来了 但是在created里却获取不到
推荐写法 使用watch监听
instance: function(newVal, _oldVal) {
this.instanceId = newVal;
//在这里调用 created 里面的函数
}
vue的子组件在created里获取不到prop的值
阅读 39
2022-04-13
props: {
instance: {
type: String,
required: true
}
},
instanceID的值明明传过来了 但是在created里却获取不到
推荐写法 使用watch监听
instance: function(newVal, _oldVal) {
this.instanceId = newVal;
//在这里调用 created 里面的函数
}
相关推荐
精彩评论(0)