Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        



License


npm version


HitCount


size

# 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