什么是父子组件使用components,引入的组件为子组件,子组件所在的当前组件为父组件。我是组件newVue({el:'#app',components:{"info":{template:"#info",},},data(){return{}}});//info组件就是当前app组件的子组件vue中数据共享方式父组件向子组件传值:v-bind属性绑定{{val}}newVue({el:'#app',components:{"info":{template:"#info",},},data(){return{nameData:"张三"}}});//info组件就是当前app组件的子组件子组件
什么是父子组件使用components,引入的组件为子组件,子组件所在的当前组件为父组件。我是组件newVue({el:'#app',components:{"info":{template:"#info",},},data(){return{}}});//info组件就是当前app组件的子组件vue中数据共享方式父组件向子组件传值:v-bind属性绑定{{val}}newVue({el:'#app',components:{"info":{template:"#info",},},data(){return{nameData:"张三"}}});//info组件就是当前app组件的子组件子组件