45 lines
1.4 KiB
Plaintext
45 lines
1.4 KiB
Plaintext
<!--components/path-view/index.wxml-->
|
|
<view>
|
|
<block wx:if="{{pathMode === 'mode1'}}">
|
|
<view class="path">
|
|
<view class="btn"
|
|
bindtap="toPath">返回上级</view>
|
|
<view class="btn"
|
|
data-index="{{0}}"
|
|
bindtap="toPath">{{firstFloorTxt}}</view>
|
|
<view class="btn"
|
|
bindtap="toPath"
|
|
data-index="{{index+1}}"
|
|
wx:key="{{index}}"
|
|
wx:for="{{currentPath}}">{{item.text}}</view>
|
|
</view>
|
|
</block>
|
|
<block wx:elif="{{pathMode === 'mode2'}}">
|
|
<view class="path">
|
|
<view class="btn"
|
|
wx:if="{{currentPath.length !==0}}"
|
|
bindtap="toPath">返回上级</view>
|
|
<view class="btn"
|
|
bindtap="toPath"
|
|
data-index="{{index}}"
|
|
wx:key="{{index}}"
|
|
wx:for="{{currentPath}}">{{item.text}}</view>
|
|
</view>
|
|
</block>
|
|
<view class="list-view">
|
|
<view wx:for="{{outValue}}"
|
|
wx:key="{{index}}"
|
|
class="list-view-item"
|
|
bindtap="tapItem"
|
|
data-text="{{item[contentKey]}}"
|
|
data-index="{{index}}">
|
|
<text class="title"
|
|
space="ensp">{{item[contentKey]}} </text>
|
|
<text wx:if="{{item.children}}"
|
|
class="tip">(进入下一级)</text>
|
|
<view class="btn"
|
|
catchtap="tapBtn"
|
|
data-item="{{item}}">{{btnTxt}}</view>
|
|
</view>
|
|
</view>
|
|
</view> |