<view wx-if="false">我隐藏了</view>
<view wx-if="true">我隐藏了</view>
>wx:if用来判断
<view wx:if="{{length >19}}">20</view>
<view wx:elif="{{length >16}}">15</view>
<view wx:else>0</view>
多个条件:
<view wx:if="{{ !a }}">逻辑非</view>
<view wx:if="{{ a || b }}">逻辑或</view>
<view wx:if="{{ a &&b }}">逻辑与</view>
1
2
3
wx:if else 的判断
<view wx:if="{{ a >5 }}">6</view>
<view wx:elif="{{ a <5 }}">4</view>
<view wx:else>5</view>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)