为了账号安全,请及时绑定邮箱和手机立即绑定

v-for里如何读取store.state的值?

v-for里如何读取store.state的值?

HUWWW 2018-10-01 17:33:51
const store = new Vuex.Store({  state: {     a: 'a'   } });<li v-for="item in list">     <img src="this.$store.state.a" /> </li>为什么这个src没有被渲染?very much Thanks in advance~~~
查看完整描述

1 回答

?
小唯快跑啊

TA贡献1863条经验 获得超2个赞

<img src="$store.state.a" />

你可以想成在 template 裡面的操作,就是在 組件scope 下。


查看完整回答
反对 回复 2018-11-05
  • 1 回答
  • 0 关注
  • 1506 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号