Blame view

src/ui/vant-weapp/notice-bar/index.wxml 987 Bytes
simon committed
1 2
<wxs src="../wxs/utils.wxs" module="utils" />

simon committed
3 4
<view
  wx:if="{{ show }}"
simon committed
5
  class="custom-class {{ utils.bem('notice-bar', { withicon: mode, wrapable }) }}"
simon committed
6 7 8
  style="color: {{ color }}; background-color: {{ backgroundColor }};"
  bind:tap="onClick"
>
simon committed
9 10 11 12 13 14 15 16 17 18
  <van-icon
    wx:if="{{ leftIcon }}"
    size="16px"
    name="{{ leftIcon }}"
    class="van-notice-bar__left-icon"
  />
  <slot wx:else name="left-icon" />

  <view class="van-notice-bar__wrap">
    <view class="van-notice-bar__content {{ !scrollable && !wrapable ? 'van-ellipsis' : '' }}" animation="{{ animationData }}">
simon committed
19 20 21 22 23 24 25 26
      {{ text }}
    </view>
  </view>

  <van-icon
    wx:if="{{ mode === 'closeable' }}"
    class="van-notice-bar__right-icon"
    name="cross"
simon committed
27
    catch:tap="onClickIcon"
simon committed
28 29
  />
  <navigator
simon committed
30
    wx:elif="{{ mode === 'link' }}"
simon committed
31 32 33 34 35
    url="{{ url }}"
    open-type="{{ openType }}"
  >
    <van-icon class="van-notice-bar__right-icon" name="arrow" />
  </navigator>
simon committed
36
  <slot wx:else name="right-icon" />
simon committed
37
</view>