其他分享
首页 > 其他分享> > vue 之 vuex

vue 之 vuex

作者:互联网

vuex:状态管理模块
1.使用
const moduleA = new Vuex.Store({
// 保存数据
state:{ 在任何组件可以通过KaTeX parse error: Expected 'EOF', got '}' at position 82: …,10,20] }̲, // 修改s…store.commit(‘increment’)
2.his.KaTeX parse error: Expected 'EOF', got '}' at position 173: … } }̲, // 获取s…store.getters.filteredList
filteredList:state => {
return state.list.filter(item => item < 10)
}
},
// 异步提交mutation,存在业务逻辑的
action: {

   }

})

const store = new Vuex.Store({
modules:{
a:moduleA
}
})
store.state.a //

标签:vue,EOF,parse,item,state,KaTeX,vuex,store
来源: https://blog.51cto.com/u_14846736/2742750