亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

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 關注
  • 1517 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號