zoukankan      html  css  js  c++  java
  • 微信小程序tab栏切换

    • index.wxml
    <text  data-current="0" class="{{currentTab == 0? 'active' : ''}}">消息</text>
    <text  data-current="1" class="{{currentTab == 1 ? 'active' : ''}}">通知</text>
    <view hidden="{{isShow}}">消息</view>
    <view hidden="{{!isShow}}">消息</view>
    
    • index.js
    data: {
        isShow: true,
        currentTab: 0
    }
    switcher: function (e) {
            if (this.data.currentTab == e.target.dataset.current) {
                return false
            } else {
                var showMode = e.target.dataset.current == 0;
                this.setData({
                    currentTab: e.target.dataset.current,
                    isShow: showMode
                })
            }
        },
    
  • 相关阅读:
    hdu1507
    zoj1654
    hdu2444
    poj3692
    hdu1150
    hdu1151
    poj2771
    hdu3829
    hdu4619
    hdu4715
  • 原文地址:https://www.cnblogs.com/luxiaoyao/p/9096706.html
Copyright © 2011-2022 走看看