index.wxml 1.9 KB

12345678910111213141516171819202122232425262728293031
  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 class="{{ utils.bem('nav-bar', { fixed }) }} custom-class {{ border ? 'van-hairline--bottom' : '' }}" style="{{ computed.barStyle({ zIndex, statusBarHeight, safeAreaInsetTop }) }}; color:{{color}}; background:{{background}}; {{ customStyle }}">
  5. <view class="van-nav-bar__content">
  6. <view class="van-nav-bar__left" style="padding:0 20rpx;height:{{menuHeight}}px;margin-top: {{menuTop}}px;border-radius:{{menuHeight/2}}px;border: 1px solid {{borderColor}};">
  7. <block wx:if="{{ back || leftText || homeButton}}">
  8. <block wx:if="{{back || leftText}}">
  9. <van-icon wx:if="{{ back }}" size="22px" name="arrow-left" custom-class="van-nav-bar__arrow" bindtap="back" color="{{iconColor}}"/>
  10. <view wx:if="{{ leftText }}" class="van-nav-bar__text" hover-class="van-nav-bar__text--hover" hover-stay-time="70" bindtap="back">{{ leftText }}</view>
  11. </block>
  12. <!-- 返回首页 -->
  13. <view wx:if="{{homeButton}}" style="height: 34rpx;margin:0 20rpx;border-right: 1px solid {{borderColor}};"></view>
  14. <block wx:if="{{homeButton}}">
  15. <van-icon size="22px" name="wap-home" custom-class="van-nav-bar__home" bindtap="home" color="{{iconColor}}"/>
  16. </block>
  17. </block>
  18. <slot wx:else name="left" />
  19. </view>
  20. <view class="van-nav-bar__title title-class van-ellipsis" style="color:{{color}};">
  21. <block wx:if="{{ title }}">{{ title }}</block>
  22. <slot wx:else name="title" />
  23. </view>
  24. <view class="van-nav-bar__right" bind:tap="onClickRight">
  25. <view wx:if="{{ rightText }}" class="van-nav-bar__text" hover-class="van-nav-bar__text--hover" hover-stay-time="70">{{ rightText }}</view>
  26. <slot wx:else name="right" />
  27. </view>
  28. </view>
  29. </view>