1.基本使用
// 父组件
methods: {
// 测试
fatherMethod() {
console.log('测试');
}
}
// 子组件
create () {
this.triggerParentMethod ()
}
methods: {
triggerParentMethod () {
this.$parent.fatherMethod()
}
}
PS: 先记录基本用法,在实践中,记录他具体的使用场景