问题描述
我是Vue.js的新手。我很困惑,我们如何设置对象以在vue.js的模板表中打印值?
我有一个用于学习vue.js的代码,这里的数据是从data.items中提取的,然后保存在变量this.items中。
之后,我们使用{{data.item.name}}
作为打印值。我们代表哪个对象设置对象?
这是我的脚本标签。
fetchItems() {
axios.get(`/getSellerProducts/${this.category}`)
.then(({
data
}) => {
this.items = data.items
})
},
模板标签
<template v-slot:cell(name)="data">
<b-img thumbnail fluid :src="getImageUrl(data.item.image)" alt="Image 1" class="thumb-img"></b-img>
{{data.item.name}}
</template>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)