1.0.7 • Published 3 years ago

nast-store v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

nast-store

Installation

npm i -S nast-store

Prepare

import NastStore from 'nast-store'
import Vue from 'vue'
import App from './App'

const stores = {
  app: {
    state: {
      user: {},
    },
    mutations: {
      user(state, value) {
        state.user = value
      },
    },
    namespaced: true,
  },
}

const store = new NastStore(Vue, stores)

global.$app = {
  store,
}

new Vue({
  store: store.store(),
  render: (h) => h(App),
}).$mount('#app')

Basic usage

$app.store.mutation('app.user', {
  username: 'admin',
  fullName: 'Administrator',
})

$app.store.state('app.user').fullName
1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago