24 lines
1.5 KiB
Plaintext
24 lines
1.5 KiB
Plaintext
<view class="van-picker custom-class">
|
|
<view class="van-picker__toolbar van-hairline--top-bottom toolbar-class" wx:if="{{showToolbar}}">
|
|
<view bindtap="emit" class="van-picker__cancel" data-type="cancel" hoverClass="van-picker__cancel--hover" hoverStayTime="70">
|
|
{{cancelButtonText}}
|
|
</view>
|
|
<view class="van-picker__title van-ellipsis" wx:if="{{title}}">{{title}}</view>
|
|
<view bindtap="emit" class="van-picker__confirm" data-type="confirm" hoverClass="van-picker__confirm--hover" hoverStayTime="70">
|
|
{{confirmButtonText}}
|
|
</view>
|
|
</view>
|
|
<view class="van-picker__loading" wx:if="{{loading}}">
|
|
<loading color="#1989fa"></loading>
|
|
</view>
|
|
<view catch:touchmove="noop" class="van-picker__columns" style="height: {{itemHeight*visibleItemCount}}px">
|
|
<picker-column activeClass="active-class" bind:change="onChange" class="van-picker__column" customClass="column-class" data-index="{{index}}" defaultIndex="{{item.defaultIndex||defaultIndex}}" initialOptions="{{isSimple(columns)?item:item.values}}" itemHeight="{{itemHeight}}" valueKey="{{valueKey}}" visibleItemCount="{{visibleItemCount}}" wx:for="{{isSimple(columns)?[columns]:columns}}" wx:key="index"></picker-column>
|
|
<view class="van-picker__frame van-hairline--top-bottom" style="height: {{itemHeight}}px"></view>
|
|
</view>
|
|
</view>
|
|
<wxs module="isSimple">
|
|
function isSimple(columns) {
|
|
return (columns.length && !columns[(0)].values)
|
|
};
|
|
module.exports = isSimple;
|
|
</wxs> |