rex 723cebac1a
[new feature] TabBar: improve performance & add new props & improve doc (#1722)
fix #1625

pull request 改动点:

- 重构组件,优化性能
- 新增 inactiveColor、name 属性
- 完善文档,增加小程序自定义tab-bar示例
2019-06-24 17:42:37 +08:00

43 lines
1.1 KiB
Plaintext

<view class="container">
<view class="title">
<image class="logo" src="https://img.yzcdn.cn/vant/logo.png" />
<view class="title-text">Vant Weapp</view>
</view>
<view class="desc">轻量、可靠的小程序 UI 组件库</view>
<van-collapse
wx:for="{{ list }}"
wx:for-item="group"
wx:key="group.title"
value="{{ activeNames }}"
border="{{ false }}"
bind:change="onChangeCollapse"
>
<van-collapse-item
clickable
is-link="{{ false }}"
custom-class="mobile-nav"
title-class="mobile-nav__title"
content-class="mobile-nav__content"
title="{{ group.groupName }}"
name="{{ group.groupName }}"
>
<van-icon
name="{{ group.icon }}"
slot="right-icon"
custom-class="mobile-nav__icon"
/>
<van-cell
wx:for="{{ group.list }}"
wx:key="item.title"
is-link
url="/pages{{ item.path }}/index"
data-url="/pages{{ item.path }}/index"
data-switch-tab="{{ true }}"
title="{{ item.title }}"
bind:click="onClick"
/>
</van-collapse-item>
</van-collapse>
</view>