article icon indicating copy to clipboard operation
article copied to clipboard

VUEX 在 web上的play ground 能用,在原生机器就跑不起来

Open fdh19979 opened this issue 6 years ago • 2 comments

如果使用this.$store.state的方式,网页上能显示,原生报错 this.$store无法模拟

如果使用 import store from ,再使用store.state,原生也能显示数据,但是使用store.commit时就没有反应了

fdh19979 avatar Mar 30 '18 04:03 fdh19979

找了一个解决方法 在store中 import Vue from 'vue' import Vuex from 'vuex'; Vue.use(Vuex);

如果import Vue,那么就web正常,原生报错 如果不 import,那么就web报错,原生正常

具体原因,分析不出

fdh19979 avatar Mar 30 '18 06:03 fdh19979

我也遇到了相同的问题,求解决方法

you85630 avatar Apr 12 '18 08:04 you85630