Created
January 24, 2021 10:10
-
-
Save iDevelopThings/548c2c528d6aafd8dc13299bca99917d to your computer and use it in GitHub Desktop.
VueJS Observable State
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
import Vue from 'vue'; | |
class SomeState { | |
constructor() | |
{ | |
this.state = Vue.observable({}); | |
} | |
} | |
export { SomeState }; | |
export default new SomeState(); | |
//In app.js where you initiate vue. | |
import SomeState from '....SomeState'; | |
Vue.prototype.$someState = SomeState; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment