当前位置 : 主页 > 编程语言 > java >

详解wx:if elif else的用法(搭配view、block)

来源:互联网 收集:自由互联 发布时间:2022-07-17
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}}" vie

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>
网友评论