我原来的代码是这样的:
<view class="item" bindtap="detail" wx:for="{{list}}" wx:key="_id" style="width: max-content; margin-right:5rpx;margin-top:5rpx;margin-bottom:5rpx; height:85px;">
<block wx:if="{{item.category}}"==祝你好梦>
<image src="{{item.image[0]}}"/>
</block>
</view>
if判断语句失效
后来发现不对劲,修改了一个wx:if就可以正确显示了
<view class="item" bindtap="detail" wx:for="{{list}}" wx:key="_id" style="width: max-content; margin-right:5rpx;margin-top:5rpx;margin-bottom:5rpx; height:85px;">
<block wx:if="{{item.category=='祝你好梦'}}">
<image src="{{item.image[0]}}"/>
</block>
</view>