pieceking
pieceking
  • 发布:2020-03-20 17:47
  • 更新:2020-03-20 17:47
  • 阅读:497

store里定义的变量,在网络的request js里怎么获取到值

分类:uni-app

const store = new Vuex.Store({
state: {
token: 'xxx'
},
mutations: {
......

上面定义的token,在vue文件里,可以用 this.$store.state.token 获取到,但在纯JS文件里, 怎么获取,通过getApp().$store.state也获取不到。

2020-03-20 17:47 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复