{{data}}
{{info}}
vuex user文件
const user = {
namespaced: true,
state: {
username: "管理员",
password: ""
},
mutations: {
SET_USERINFO: (state, userInfo) => {
state.username = userInfo.username ? userInfo.username : "";
state.password = userInfo.password ? userInfo.password : "";
}
},
actions: {
// 登录
Login({ commit }, userInfo) {
commit("SET_USERINFO", userInfo)
}
}
};
export default user;