标签(空格分隔): vue
父组件调用子组件方法
子组件中
this.$emit('nodeClick', obj);
父组件中
<report-real class="zero-real" ref="reportReal" @nodeClick='showSecond'></report-real>
//主要看nodeClick showSecond 是父组件的方法
子组件调用父组件方法
子组件
this.$parent.fatherMethod();
父组件
methods: {
fatherMethod() {
console.log('测试');
}
};











网友评论