wx.if判断

190 阅读1分钟

wx.if判断

<view wx:if="{{flag==1}}">我是墩墩小可爱</view>

<view wx:elif="{{flag==2}}">我是墩墩小倒霉</view>

<view wx:else="{{flag==2}}">我是墩墩倒霉</view>

<button bindtap="qie">切换</button>
复制代码

wx:for循环

<view wx:for="{{list}}" wx:key="index"

wx:for-item="r" wx:for-index="i">

{{r}}--{{i}}

</view>
复制代码

路由实现应用内页面跳转

     <!-- mypage.wxml -->
    <button bindtap="go1" style="margin: 3px;">张三</button>

    <button bindtap="go2" style="margin: 3px;">李四</button>

    <button bindtap="go3" style="margin: 3px;">24号</button>

    <button bindtap="go4" style="margin: 3px;">不带参数</button>

    <!-- mypage.js -->