Last active
September 6, 2021 16:03
-
-
Save neodigm/6c70047af8734667e8cf176b81c12377 to your computer and use it in GitHub Desktop.
Vuejs Provide Inject Reactive Component Communication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//. Parent Component | |
provide() { | |
return { | |
cyRef: this.cytoRef, | |
obsId: this.obsId, | |
hostname: () => this.reactiveHostname | |
} | |
} | |
//. Child Component | |
inject: ['cyRef', 'hostname'], | |
// Add computed - | |
compCyRef(){ | |
return this.cyRef() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment