vuex-models

0

Описание

Simple two-way data binding between vue components and vuex store

Языки

  • JavaScript100%
README.md

vuex-models

This package is aims to simplify

v-model
usage with your vuex state, by providing
getter/action/mutation/state
generator and mapper, that generates
v-model
compatible computed properties.

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

vuex-models
for namespaced vuex modules. All you need is to pass second argument to
mapVuexModels
with namespace name:

Rename computed properties

Like vuex mappers, mapVuexModels supports properties renaming: