index.wxml 1.38 KB
Newer Older
李嘉林 committed
1
<wxs src="../wxs/utils.wxs" module="utils" />
程默 committed
2 3 4
<wxs src="./index.wxs" module="computed" />

<view wx:if="{{ fixed && placeholder }}" style="height: {{ height }}px;" />
李嘉林 committed
5 6 7

<view
  class="{{ utils.bem('nav-bar', { fixed }) }} custom-class {{ border ? 'van-hairline--bottom' : '' }}"
程默 committed
8
  style="{{ computed.barStyle({ zIndex, statusBarHeight, safeAreaInsetTop }) }}; {{ customStyle }}"
李嘉林 committed
9
>
程默 committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
  <view class="van-nav-bar__content">
    <view class="van-nav-bar__left" bind:tap="onClickLeft">
      <block wx:if="{{ leftArrow || leftText }}">
        <van-icon
          wx:if="{{ leftArrow }}"
          size="16px"
          name="arrow-left"
          custom-class="van-nav-bar__arrow"
        />
        <view
          wx:if="{{ leftText }}"
          class="van-nav-bar__text"
          hover-class="van-nav-bar__text--hover"
          hover-stay-time="70"
        >{{ leftText }}</view>
      </block>
      <slot wx:else name="left" />
    </view>
    <view class="van-nav-bar__title title-class van-ellipsis">
      <block wx:if="{{ title }}">{{ title }}</block>
      <slot wx:else name="title" />
    </view>
    <view class="van-nav-bar__right" bind:tap="onClickRight">
李嘉林 committed
33
      <view
程默 committed
34
        wx:if="{{ rightText }}"
李嘉林 committed
35 36 37
        class="van-nav-bar__text"
        hover-class="van-nav-bar__text--hover"
        hover-stay-time="70"
程默 committed
38 39 40
      >{{ rightText }}</view>
      <slot wx:else name="right" />
    </view>
李嘉林 committed
41 42
  </view>
</view>