index.wxml 987 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <wxs src="../wxs/utils.wxs" module="utils" />
  2. <view
  3. wx:if="{{ show }}"
  4. class="custom-class {{ utils.bem('notice-bar', { withicon: mode, wrapable }) }}"
  5. style="color: {{ color }}; background-color: {{ backgroundColor }};"
  6. bind:tap="onClick"
  7. >
  8. <van-icon
  9. wx:if="{{ leftIcon }}"
  10. size="16px"
  11. name="{{ leftIcon }}"
  12. class="van-notice-bar__left-icon"
  13. />
  14. <slot wx:else name="left-icon" />
  15. <view class="van-notice-bar__wrap">
  16. <view class="van-notice-bar__content {{ !scrollable && !wrapable ? 'van-ellipsis' : '' }}" animation="{{ animationData }}">
  17. {{ text }}
  18. </view>
  19. </view>
  20. <van-icon
  21. wx:if="{{ mode === 'closeable' }}"
  22. class="van-notice-bar__right-icon"
  23. name="cross"
  24. catch:tap="onClickIcon"
  25. />
  26. <navigator
  27. wx:elif="{{ mode === 'link' }}"
  28. url="{{ url }}"
  29. open-type="{{ openType }}"
  30. >
  31. <van-icon class="van-notice-bar__right-icon" name="arrow" />
  32. </navigator>
  33. <slot wx:else name="right-icon" />
  34. </view>