index.wxml 1.4 KB

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