index.wxml 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. 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 === false && !wrapable ? 'van-ellipsis' : '' }}" animation="{{ animationData }}">
  17. {{ text }}
  18. <slot wx:if="{{ !text }}"></slot>
  19. </view>
  20. </view>
  21. <van-icon
  22. wx:if="{{ mode === 'closeable' }}"
  23. class="van-notice-bar__right-icon"
  24. name="cross"
  25. catch:tap="onClickIcon"
  26. />
  27. <navigator
  28. wx:elif="{{ mode === 'link' }}"
  29. url="{{ url }}"
  30. open-type="{{ openType }}"
  31. >
  32. <van-icon class="van-notice-bar__right-icon" name="arrow" />
  33. </navigator>
  34. <slot wx:else name="right-icon" />
  35. </view>