vue-axios-github icon indicating copy to clipboard operation
vue-axios-github copied to clipboard

在http.js中无法读取store

Open cdpv587 opened this issue 7 years ago • 5 comments

qq 20180428210751

cdpv587 avatar Apr 28 '18 13:04 cdpv587

打印出来store是undefine 为什么呢? 麻烦指点一下

cdpv587 avatar Apr 28 '18 13:04 cdpv587

你在哪里存储登录成功后的返回值的呢? 我的项目中是这么写的:https://github.com/superman66/vue-axios-github/blob/master/src/login.vue#L29

superman66 avatar Apr 28 '18 13:04 superman66

这无关于存储,我store这个引入是没有任何东西的,也就是说import 失败。 image

正常你打印出来应该是这样的

cdpv587 avatar Apr 28 '18 13:04 cdpv587

看错题目了。我看出 userToken 打印出来是 undefined。那得看你 store/index 是怎么初始化的。应该是初始化出现问题了

superman66 avatar Apr 28 '18 14:04 superman66

image image import的顺序不同就会导致读取不出,第一个是错误的情况。请问一下这个顺序为什么会导致读取不出?

cdpv587 avatar May 02 '18 03:05 cdpv587