index.axml 1.3 KB

1234567891011121314151617
  1. <view class='dropdown-item-index {{className}}' style='{{style}}' ref='saveChildRef0'>
  2. <import-sjs from='../wxs/utils.sjs' name='utils'>
  3. </import-sjs>
  4. <view a:if='{{ showWrapper }}' class="{{ utils.bem('dropdown-item', direction) }}" style='{{ wrapperStyle }}'>
  5. <van-popup show='{{ showPopup }}' custom-style='position: absolute;{{ popupStyle }}' overlay-style='position: absolute;' overlay='{{ overlay }}' position="{{ direction === 'down' ? 'top' : 'bottom' }}" duration='{{ transition ? duration : 0 }}' close-on-click-overlay='{{ closeOnClickOverlay }}' onEnter='onOpen' onLeave='onClose' onClose='toggle' onAfter-enter='onOpened' onAfter-leave='onClosed' ref='saveChildRef1'>
  6. <van-cell a:for='{{ options }}' a:key='{{*this}}' data-option='{{ item }}' class="{{ utils.bem('dropdown-item__option', { active: item.value === value } ) }}" clickable=" " icon='{{ item.icon }}' onClick='onOptionTap' ref-numbers='{{ options }}' ref='saveChildRef2'>
  7. <view slot='title' class='van-dropdown-item__title' style="{{ item.value === value ? 'color:' + activeColor : '' }}">
  8. {{ item.text }}
  9. </view>
  10. <van-icon a:if='{{ item.value === value }}' name='success' class='van-dropdown-item__icon' color='{{ activeColor }}' ref='saveChildRef3'>
  11. </van-icon>
  12. </van-cell>
  13. <slot>
  14. </slot>
  15. </van-popup>
  16. </view>
  17. </view>