Vuex页面跳转获取不到值,值为undefined

weixin_38062545 2018-03-28 07:00:24
vuex页面跳转获取不到值,值为undefined,一个vue页面设置的值,另一个vue页面取不到值
...全文
1079 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_38121944 2018-03-29
  • 打赏
  • 举报
回复
参考我这个项目的代码吧 github.com JasonBai007/vue-seed/blob/master/src/components/charts/Line.vue#L88 renderLine() { console.log("renderLine被执行"); let opts = { title: { text: "近五天气温趋势", x: "center", textStyle: { color: "#666" } }, color: this.$store.state.common.chartTheme, grid: { top: "20%", left: "3%", right: "3%", bottom: "12%", containLabel: true }, tooltip: { trigger: "axis" },
weixin_38093364 2018-03-29
  • 打赏
  • 举报
回复
不是改变值,是在另一个页面取值
weixin_38108228 2018-03-29
  • 打赏
  • 举报
回复
改变state里面的值,必须用mutations。。。。。认真看一下文档亲
weixin_38096807 2018-03-28
  • 打赏
  • 举报
回复
没用mutations,也需要commit吗?
weixin_38109674 2018-03-28
  • 打赏
  • 举报
回复
设置值以后,需要commit的

433

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧