vuex 修改参数
import Vue from 'vue' import Vuex from 'vuex' import router from '@/router' import Cookie from 'js-cookie' Vue.use(Vuex) export default new Vuex.Store({ state: { ycStoreToken: '', menuList: [], // 菜单列表 menuRoutes: [], // 匹配到的路由 breadcrumb: [], // 导航 imgUrls: {} }, getters: { }, mutations: { // 修改参数 changeStateParams (state, data) { if (typeof data === 'object') { for (var key in data) { if (Object.prototype.hasOwnProperty.call(state, key)) { const param = data[key] state[key] = param }; } } } }, actions: { // 修改参数 aChangeStateParams ({ commit }, data) { if (typeof data === 'object') { commit('changeStateParams', data) } } }, modules: { } })