template view view class=a objtitle view view class=b objbody view view style=padding 30rpx; view style=display flex;justify-content center; 评论 view view v-for=item in comments key=
根据您提供的代码,item的值不起作用可能是因为在v-for循环中,您没有正确绑定item的属性值。
请尝试修改您的代码如下:
<view v-for="item in comments" :key="item.id">
<view style="display: flex;justify-content: space-between;font-size: 10rpx;">
<view>
{{ item.name }}
</view>
<view>
{{ item.email }}
</view>
</view>
<view style="display: flex;justify-content: center;">
{{ item.body }}
</view>
</view>
在上述代码中,我们使用了双花括号语法{{ }}来正确绑定item对象的属性值,确保显示正确的内容。
如果问题仍然存在,请提供更多的代码和错误信息,以便更好地帮助您解决问题。
原文地址: https://www.cveoy.top/t/topic/imUV 著作权归作者所有。请勿转载和采集!