index.wxml 1.1KB

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