vuex-models
Описание
Simple two-way data binding between vue components and vuex store
Языки
- JavaScript100%
4 года назад
5 лет назад
5 лет назад
8 лет назад
5 лет назад
6 лет назад
5 лет назад
8 лет назад
4 года назад
2 года назад
4 года назад
6 лет назад
README.md
vuex-models
This package is aims to simplify usage with your vuex state, by providing v-model generator and mapper, that generates getter/action/mutation/state compatible computed properties.v-model
It is compatible with Vue 2.x
Installation
Just use npm:
npm i --save vuex-models
Usage
Using vuex-models is a dead simple - first you need to generate store fields like this:
Then, in your vue components you can map computed properties by using :mapVuexModels
Vuex namespaced stores
Also you can use for namespaced vuex modules. All you need is to pass second argument to vuex-models with namespace name:mapVuexModels
Rename computed properties
Like vuex mappers, mapVuexModels supports properties renaming: