父组件
provide () {
const vm = this
return {
getinternalApi (api) {
vm.audioapi = api
}
}
}
子组件
inject: [''getinternalApi]
扫描二维码关注公众号,回复:
8067649 查看本文章
computed: {
if(typeof this.getinternalApi=== 'function'){
this.getinternalApi({
pause:this.pause.bind(this)
})
}
}