Skip to content

kmtong/vmx-vuex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to Use

启动

import Vue from 'vue'

import VueModx from 'vue-modx'
import VuexModule from 'vmx-vuex'

// start plugin framework
Vue.use(VueModx, {
  modules: [VuexModule],
  config: {}
})

// get store to create Vue object
const store = VuexModule.store()

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

扩展

export default {
  name: 'user-state',
  dependsOn: ['vuex'],
  extensions: {
    'vuex.modules': {
      user: {
        state: () => ({ ... }),
        mutations: { ... },
        actions: { ... },
        getters: { ... } 
      },
      corp: {
        state: () => ({ ... }),
        mutations: { ... },
        actions: { ... },
        getters: { ... } 
      }
    }
  }
}

扩展点:

  • vuex.modules
  • vuex.state
  • vuex.mutations
  • vuex.getters
  • vuex.actions

About

Vuex Module Extension

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published