index.wxml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <view class="van-picker">
  2. <view class="van-picker__toolbar van-hairline--bottom">
  3. <view class="van-picker__cancel" bindtap="onCancel">取消</view>
  4. <view class="van-picker__title">{{ title }}</view>
  5. <view class="van-picker__confirm" bindtap="onConfirm">确定</view>
  6. </view>
  7. <view wx:if="{{ loading }}" class="van-picker__loading">
  8. <van-loading color="#1989fa"/>
  9. </view>
  10. <picker-view
  11. indicator-style="height: {{ itemHeight }}px;"
  12. style="width: 100%; height: {{ itemHeight * visibleItemCount + 'px' }}"
  13. bindchange="onChange"
  14. value="{{ pickerValue }}"
  15. class="van-picker__columns"
  16. >
  17. <picker-view-column
  18. wx:if="{{ rowIndex < columnsNum }}"
  19. wx:for="{{ columns }}"
  20. wx:for-item="row"
  21. wx:for-index="rowIndex"
  22. wx:key="rowIndex"
  23. class="van-picker-column"
  24. >
  25. <view
  26. wx:for="{{ row }}"
  27. wx:key="{{ item.code }}"
  28. style="line-height: {{ itemHeight }}px;"
  29. class="van-picker-column__item {{ index === pickerValue[rowIndex] ? 'van-picker-column__item--selected' : '' }}"
  30. >{{ item.name }}</view>
  31. </picker-view-column>
  32. </picker-view>
  33. </view>