[Vuejs]-Play music button on global components work for child components

0👍

If you want to control the logic of a component from another component, you can pass a pub/sub object to props. In Home.vue call pubsub.exec(), and in music-player.vue do pubsub.subscribe(()=>… my logic). Or use the regular Vue Provide / Inject approach (https://vuejs.org/guide/components/provide-inject.html)

Leave a comment