从vue.json父组件继承子组件
Parent.Vue从vue.json父组件继承子组件,vue.js,Vue.js,Parent.Vue msg:"", parentData: {msg:[]}, methods: { response(file, respone) { this.msg = respone console.log(respone) }, } Child.Vue {{parentData.msg} 我希望将从父组件接收的json数据作为子组件继承 json数据格式作为照片上传 使用道具将数据从父组件传递到子组
msg:"",
parentData: {msg:[]},
methods: {
response(file, respone) {
this.msg = respone
console.log(respone)
},
}
Child.Vue
{{parentData.msg}
我希望将从父组件接收的json数据作为子组件继承
json数据格式作为照片上传
使用道具将数据从父组件传递到子组件
比如说
Vue.component('Child'{
道具:['parentData'],
模板:`
小孩
父母亲
msg={{msg}
那么,问题出在哪里?@nada json数据是从后端接收的,不能将值从父组件传递给子组件。@nada我想将msg
中包含的json数据继承给子组件。@nada Postedited@nada试试看……msg:,parentData:{msg:'{{msg.rate{u成人}},}),
失败