Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mudin/vue-global-var
Reactive global variable can be sharable between components
https://github.com/mudin/vue-global-var
global mixins ractive variables vue vue-mixin vuex
Last synced: about 1 month ago
JSON representation
Reactive global variable can be sharable between components
- Host: GitHub
- URL: https://github.com/mudin/vue-global-var
- Owner: mudin
- License: mit
- Created: 2019-02-16T14:49:51.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-14T00:30:17.000Z (over 5 years ago)
- Last Synced: 2024-11-11T19:26:03.131Z (about 1 month ago)
- Topics: global, mixins, ractive, variables, vue, vue-mixin, vuex
- Language: JavaScript
- Homepage: https://mudin.github.io/vue-global-var-demo/
- Size: 77.1 KB
- Stars: 22
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-global-var
Reactive global variable can be sharable between components
[Demo](https://mudin.github.io/vue-global-var-demo/)
## Dependencies
- [Vue](https://github.com/vuejs/vue)
- [Vuex](https://github.com/vuejs/vuex)## Installation
```bash
$ npm install --save vue-global-var
```## How to use
```js
Vue.use(VueGlobalVar, {
globals: {
$user: new User('user1'),
obj:{},
config:Config,
....
},
});
```Now just use `this.$user` is any component or `$user` in its template
## License
MIT