import Vue from \'vue\'
import Vuex from \'vuex\'
Vue.use(Vuex);

const store = new Vuex.Store({
  state: {
    await:true,                                               // 等待状态
    temp:\'/financeProductManage\',
    pageTab:[{path:\'/homePage\',name:\'主页\'}],
    pageIndex:0,
    topath:\'\',
    custCis:\'\'
  },
  mutations: {
    \"SET_CUSTCIS\": function (state,custCis) {
      state.custCis = custCis;
    },
    \"SET_AWAIT\": function (state,trueth) {
      state.await = trueth;
    },
    \"SET_PAGETAB\": function (state,obj) {
      state.pageTab.push(obj);
      state.pageIndex = state.pageTab.length-10;
    },
    \"SET_TEMP\": function (state,str) {
      state.temp = str;
    },
    \"REP_PAGETAB\": function (state,list) {
      state.pageTab = list;

      console.log(state.pageIndex)
    },
    \"TO_PTATH\" : function (state,pth) {
      state.topath = pth;

    },
    \"DEL_PAGETAB\": function (state,n) {

      state.pageTab.splice(n,1);
      state.pageIndex = state.pageTab.length-10;
      console.log(state.pageIndex)
    },
  },
  getters: {
    \"GET_MSG\": function(state) {
      console.log(\'获取\', state.await);
      return state.await
    }
  },
  actions: {
    \"SET_MSG\": function(state, user_name) {
      console.log(\'获取\', state.user_name);
      setTimeout(function () {
        store.commit(\"SET_AWAIT\", user_name)
      },1000)
    },
  }
});
export default store

 

收藏 打印