Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从vue.json父组件继承子组件_Vue.js - Fatal编程技术网

从vue.json父组件继承子组件

从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数据格式作为照片上传 使用道具将数据从父组件传递到子组

Parent.Vue

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成人}},}),
失败