【发布时间】:2017-09-06 08:36:20
【问题描述】:
我将这个用VueJs + AdminLTE 项目制作的简单管理仪表板克隆到我的本地,到目前为止一切正常......但我目前正在努力找出如何从 vuex 获取存储状态,特别是从我修改过的this line of code到:
// if user loggedin
if(response.data && response.status == 200){
this.$store.commit("USERNAME", data.username)
this.$store.commit("TEL", data.tel)
this.$store.commit('EMAIL', data.email)
this.$router.push({ path: '/' })
}
一旦页面被重定向,我试图获取用户名、电话、电子邮件,但它不存在。
我做了console.log(this.$store) 我看到了很多内容,但没有看到用户信息
【问题讨论】: