riku
2026-04-02 3282e95db0207ee133d1e98d9771dec9d83b0fc4
miniprogram_npm/tdesign-miniprogram/picker-item/picker-item.wxml
@@ -1,25 +1 @@
<wxs src="../common/utils.wxs" module="_" />
<view
  style="{{_._style([style, customStyle])}}"
  class="{{_.cls(classPrefix + '__group', [])}} class {{prefix}}-class"
  bind:touchstart="onTouchStart"
  catch:touchmove="onTouchMove"
  bind:touchend="onTouchEnd"
  bind:touchcancel="onTouchEnd"
>
  <view
    class="{{classPrefix}}__wrapper"
    style="transition: transform {{ duration }}ms cubic-bezier(0.215, 0.61, 0.355, 1); transform: translate3d(0, {{ offset }}px, 0)"
  >
    <view
      class="{{_.cls(classPrefix + '__item', [['active', curIndex == index]])}}"
      wx:for="{{options}}"
      wx:key="index"
      wx:for-item="option"
      data-index="{{ index }}"
    >
      {{option[labelAlias]}}
    </view>
  </view>
</view>
<wxs src="../common/utils.wxs" module="_"/><view style="{{_._style([style, customStyle, 'height:' + itemHeight * visibleItemCount + 'px'])}}" class="{{_.cls(classPrefix + '__group', [])}} class {{prefix}}-class" bind:touchstart="onTouchStart" catch:touchmove="onTouchMove" bind:touchend="onTouchEnd" bind:touchcancel="onTouchEnd"><view class="{{classPrefix}}__wrapper" style="transition: transform {{ duration }}ms cubic-bezier(0.215, 0.61, 0.355, 1); transform: translate3d(0, {{ offset }}px, 0); padding: {{ wrapperPaddingY }}px 0"><view wx:if="{{enableVirtualScroll}}" style="height: {{totalHeight}}px; position: relative;"><view style="position: absolute; top: {{virtualOffsetY}}px; left: 0; right: 0;"><view class="{{_.cls(classPrefix + '__item', [['active', curIndex == (virtualStartIndex + index)]])}}" style="height: {{itemHeight}}px" wx:for="{{visibleOptions}}" wx:key="value" wx:for-item="option" data-index="{{ virtualStartIndex + index }}" bind:tap="onClickItem"><t-icon wx:if="{{option[pickerKeys.icon]}}" class="{{classPrefix}}__item-icon" name="{{option[pickerKeys.icon]}}"/><text class="{{classPrefix}}__item-label">{{option[pickerKeys.label]}}</text><slot name="label-suffix--{{virtualStartIndex + index}}"></slot></view></view></view><block wx:else><view class="{{_.cls(classPrefix + '__item', [['active', curIndex == index]])}}" style="height: {{itemHeight}}px" wx:for="{{visibleOptions}}" wx:key="value" wx:for-item="option" data-index="{{ index }}" bind:tap="onClickItem"><t-icon wx:if="{{option[pickerKeys.icon]}}" class="{{classPrefix}}__item-icon" name="{{option[pickerKeys.icon]}}"/><text class="{{classPrefix}}__item-label">{{option[pickerKeys.label]}}</text><slot name="label-suffix--{{index}}"></slot></view></block></view></view>