<view class="section" >
<view class="card" wx:for="{{usersHonor}}">
<image src="{{item.avatar}}"></image>
<text>{{item.honorPoint}}</text>
</view>
</view>
过滤item.honorPoint,如:当值为空时,显示0。vue中可以直接套用方法。
<view class="section" >
<view class="card" wx:for="{{usersHonor}}">
<image src="{{item.avatar}}"></image>
<text>{{item.honorPoint}}</text>
</view>
</view>
过滤item.honorPoint,如:当值为空时,显示0。vue中可以直接套用方法。
13 回答12.8k 阅读
7 回答1.9k 阅读
3 回答1.1k 阅读✓ 已解决
2 回答1.2k 阅读✓ 已解决
4 回答861 阅读✓ 已解决
6 回答873 阅读✓ 已解决
6 回答1k 阅读
试试这么写
{{item.honorPoint || 0}}