详解wx:if elif else的用法(搭配view、block)
原创
©著作权归作者所有:来自51CTO博客作者成都阿信的原创作品,请联系作者获取转载授权,否则将追究法律责任
1、搭配view
<view wx:if="{{boolean==true}}">
<view class="bg_black"></view>
</view>
<view wx:elif="{{boolean==false}}">
<view class="bg_red"></view>
</view>
<view wx:elif>
<view class="bg_red"></view>
</view>
2、搭配block
<block wx:if="{{order.kind===3}}">
<view class="bg_black"></view>
</block>
<block wx:else>
<view class="bg_red"></view>
</block>
<block wx:if="{{boolean==true}}">
<view class="bg_black"></view>
</block>
<block wx:elif="{{boolean==false}}">
<view class="bg_red"></view>
</block>
<block wx:else>
<view class="bg_red"></view>
</block>