Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/LancerComet/vuexer
Transport data between component and vuex in whole project. Only for Vue 1.
https://github.com/LancerComet/vuexer
Last synced: 13 days ago
JSON representation
Transport data between component and vuex in whole project. Only for Vue 1.
- Host: GitHub
- URL: https://github.com/LancerComet/vuexer
- Owner: LancerComet
- License: apache-2.0
- Archived: true
- Created: 2017-01-18T07:07:25.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-05-12T08:07:18.000Z (about 2 years ago)
- Last Synced: 2024-02-25T14:33:28.346Z (4 months ago)
- Language: TypeScript
- Size: 132 KB
- Stars: 6
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-vue-refactor - vuexer
README
# Vuexer
[![Vuexer](https://github.com/LancerComet/vuexer/workflows/Test/badge.svg)](https://github.com/LancerComet/vuexer/actions)
[![npm version](https://badge.fury.io/js/vuexer.svg)](https://badge.fury.io/js/vuexer)## What's wrong with the "Vue 1 + Vuex 1"?
If you want to distribute some vue 1 components to npm or somewhere else, and these components use Vuex 1 as its state manager, Vue 1 + Vuex 1 just can't do this.
So this package is designed to solve this problem. It adds a new properity `$vuexer` in all vue components, so that you can use `$vuexer` as a bridge to communicate with each other.
Only for Vue 1.0, because "Vue 2.0 + Vuex 2.0" has solved this problem.
## Quick Start
```javascript
import Vue from 'vue'
import Vuexer from 'vuexer'import store from './vuex/store'
import actions from './vuex/actions'
import getters from './vuex/getters'Vue.use(Vuexer, {
store,
actions,
getters
})
```After vuexer has been initialized, a new property called `$vuexer` will be added to your components.
Let's see:
```html
export default {
methods: {
setCurrency (num) {
this.$vuexer.setCurrency(num) // "setCurrency" is the method that you defined in your vuex actions.
}
}
}
currency: {{$vuexer.getCurrency}}
I need $10!
$100 is required!
```
Now you want to have this code in your component, and you are going to distribute it to somewhere.
Once a project uses this component, just make sure Vuexer is installed in this project and everything will be fine.
## License
Apache-2.0