扫码关注官方订阅号
const store = new Vuex.Store({ state: { a: 'a' } });
为什么这个src没有被渲染?
very much Thanks in advance~~~
走同样的路,发现不同的人生
<img src="$store.state.a" />
你可以想成在 template 裡面的操作,就是在 組件scope 下。
template
組件scope
结贴~~~
v-for循环中,貌似this指向并不是Vue,在模板中
<img :src="a" /> data () { return { a: this.$store.state.a } }
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
你可以想成在
template裡面的操作,就是在組件scope下。结贴~~~
v-for循环中,貌似this指向并不是Vue,在模板中