[toc]
modules即是store里的store
一般是按照不同組件模塊而分的子store
并且可以無限遞歸先去
```
,modules:{
a:{
//默認為false
// namespaced:true,
state:{
text:'a'
}
,mutations:{
updateText(state){
//這個state是 a模塊單獨的state 而不是全部
}
}
,getters:{
textPlus(state,getters,rootState){
return state.text + rootState.count;
}
}
,actions:{
// add(ctx){
// //ctx是值屬于當前模塊的子store對象
// }
add({state,commit,rootState}){
//提交到的是本模塊的updateText
//{root:true}能提交到全局的updateText
// commit('updateText',rootState.count/*,{root:true}*/);
commit('updateCount',{num:56789},{root:true});
}
}
}
,b:{
state:{
text:'b'
}
}
}
});
```
- 空白目錄
- vue-cli
- runtime-only
- Vue對比React
- 組件與實例
- data-binding
- computed的set和get
- scoped
- 事件
- 自定義指令
- 插件
- keep-alive
- $nextTick與生命周期
- 路由
- Vue.use(Router)
- this.$router編程式導航
- this.$route
- new Router
- routes
- mode
- linkClass
- scrollBehavior
- query
- fallback
- base
- router-view
- router-link
- 路由守衛
- 左右切換
- 滾動
- FAQ
- vuex
- 適用
- new Vuex.Store
- state
- mutations
- getters
- actions
- strict
- plugins
- modules
- namespace
- this.$store
- commit
- dispatch
- mapXX
- eventBus
- Vue工程相關
- 引用路徑的簡化
- css-module
- vue-loader
- 異步加載
- 支持jsx
- 讓webpack支持對vuex的熱替換
- .eslintrc