zoukankan      html  css  js  c++  java
  • 使用iview weapp组件 写小程序 tab切换

    wxml:

    <i-row class="tab_question">
    <i-col span="24" i-class="col-class">
    <i-tabs current="{{ current }}" color="#f759ab" bindchange="handleChange" >
    <i-tab wx:for="{{type}}"
    wx:key="{{index}}"
    key="tab{{index+1}}"
    id="{{index}}"
    title="{{item.typename}}"
    >
    </i-tab>
    </i-tabs>
    <i-cell-group wx:for="{{type}}" wx:key="{{index}}" class="right-item {{current=='tab'+(index+1) ? 'active' : ''}}">
    <i-cell
    wx:for="{{item.question}}"
    wx:key="{{index}}"
    title="{{item.question}}"
    data-id="{{item.id}}"
    bindtap="answerChange"
    >
    </i-cell>
    </i-cell-group>
    </i-col>
    </i-row>

    js:

    handleChange ({ detail }) {
    this.setData({
    current: detail.key,
    show: detail.key
    });
    },

    css:

    .right-item{display: none}
    .active{display: block}

  • 相关阅读:
    2019/10/9 CSP-S 模拟测
    简单的面向对象
    魔术变量
    函数
    全局变量
    超级全局变量
    for循环
    while循环
    php数组排序
    python打造XslGenerator
  • 原文地址:https://www.cnblogs.com/wjhaaa/p/9805576.html
Copyright © 2011-2022 走看看