index.wxml
882 字节
<view
class="tree-select"
style="height: {{ mainHeight }}px"
>
<view class="tree-select__nav">
<view
wx:for="{{ items }}"
wx:key="index"
class="tree-select__nitem van-ellipsis {{ mainActiveIndex === index ? 'tree-select__nitem--active' : '' }}"
data-index="{{ index }}"
bind:tap="onClickNav"
>
{{ item.text }}
</view>
</view>
<view
class="tree-select__content"
style="height: {{ itemHeight }}px"
>
<view
wx:for="{{ subItems }}"
wx:key="item.id"
class="tree-select__item van-ellipsis {{ activeId === item.id ? 'tree-select__item--active' : '' }}"
data-item="{{ item }}"
bind:tap="onSelectItem"
>
{{ item.text }}
<van-icon
wx:if="{{ activeId === item.id }}"
name="success"
class="tree-select__selected"
/>
</view>
</view>
</view>