index.wxml 885 B

1234567891011121314151617181920212223
  1. <wxs src="../wxs/utils.wxs" module="utils" />
  2. <wxs src="./index.wxs" module="computed" />
  3. <view
  4. class="van-picker-column custom-class"
  5. style="{{ computed.rootStyle({ itemHeight, visibleItemCount }) }}"
  6. bind:touchstart="onTouchStart"
  7. catch:touchmove="onTouchMove"
  8. bind:touchend="onTouchEnd"
  9. bind:touchcancel="onTouchEnd"
  10. >
  11. <view style="{{ computed.wrapperStyle({ offset, itemHeight, visibleItemCount, duration }) }}">
  12. <view
  13. wx:for="{{ options }}"
  14. wx:for-item="option"
  15. wx:key="index"
  16. data-index="{{ index }}"
  17. style="height: {{ itemHeight }}px"
  18. class="van-ellipsis {{ utils.bem('picker-column__item', { disabled: option && option.disabled, selected: index === currentIndex }) }} {{ index === currentIndex ? 'active-class' : '' }}"
  19. bindtap="onClickItem"
  20. >{{ computed.optionText(option, valueKey) }}</view>
  21. </view>
  22. </view>