vuex中mutations异步调用以及读取值

/*
  *@Author: FangbinGuo
  *@Date:2023-09-11 10:57:45
  *@Description:
  
*/

const state= {
  // 土建 闪烁
  TJShanShuo:"",
  // 土建 菜单更新
  TJCaiDanUpdate:"",
  // 管片 闪烁
  GPShanShuo:"",
  // 管片 菜单更新
  GPCaiDanUpdate:"",
}
const mutations= {
  // ------------------------------土建
  SET_TJShanShuo:(state,value)=>{
    state.TJShanShuo=value;
  },
  SET_TJCaiDanUpdate:(state,value)=>{
    state.TJCaiDanUpdate=value;
  },
  // ------------------------------管片
  SET_GPShanShuo:(state,value)=>{
    state.GPShanShuo=value;
  },
  SET_GPCaiDanUpdate:(state,value)=>{
    state.GPCaiDanUpdate=value;
    // console.log("pppppppp==============",state.GPCaiDanUpdate)
  },
}


export default{
  state,
  mutations,
}

你可能感兴趣的:(html5,javascript,ajax,vue.js,前端框架,前端)