不使用以上技术时我们一般是使用ref
<Son ref="son" />
methods:{
parentMethod() {
console.log(this.$refs.son) //返回的是一个vue对象,所以可以直接调用其方法
this.$refs.son.childMethod(this.flag);
}
}
使用以上技术的情况下
(this.$refs.son as any).childMethod()