父组件
provide () {
const vm = this
return {
getinternalApi (api) {
vm.audioapi = api
}
}
}
子组件
inject: [''getinternalApi]
computed: {
if(typeof this.getinternalApi=== 'function'){
this.getinternalApi({
pause:this.pause.bind(this)
})
}
}