link.wxml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <import src="../common/template/icon.wxml" />
  2. <wxs src="../common/utils.wxs" module="_" />
  3. <navigator
  4. class="{{className}} class {{prefix}}-class"
  5. style="{{_._style([style, customStyle])}}"
  6. target="{{navigatorProps.target}}"
  7. url="{{navigatorProps.url}}"
  8. open-type="{{navigatorProps.openType || 'navigate'}}"
  9. delta="{{navigatorProps.delta}}"
  10. app-id="{{navigatorProps.appId}}"
  11. path="{{navigatorProps.path}}"
  12. extra-data="{{navigatorProps.extraData}}"
  13. version="{{navigatorProps.version}}"
  14. short-link="{{navigatorProps.shortLink}}"
  15. hover-class="{{ hover && !disabled && classPrefix + '--hover' }} {{prefix}}-class-hover {{navigatorProps.hoverClass}}"
  16. hover-stop-propagation="navigatorProps.hoverStopPropagation"
  17. hover-start-time="{{navigatorProps.hoverStartTime}}"
  18. hover-stay-time="{{navigatorProps.hoverStayTime}}"
  19. bindsuccess="onSuccess"
  20. bindfail="onFail"
  21. bindcomplete="onComplete"
  22. aria-disabled="{{status === 'disabled'}}"
  23. >
  24. <view class="{{classPrefix}}__prefix-icon {{prefix}}-class-prefix-icon">
  25. <slot name="prefix-icon" />
  26. <template
  27. wx:if="{{_prefixIcon}}"
  28. is="icon"
  29. data="{{tClass: prefix + '-class-prefix-icon', ariaHidden: true, ..._prefixIcon }}"
  30. />
  31. </view>
  32. <view class="{{classPrefix}}__content {{prefix}}-class-content">
  33. <block wx:if="{{content}}">{{content}}</block>
  34. <slot name="content" />
  35. <slot />
  36. </view>
  37. <view class="{{classPrefix}}__suffix-icon {{prefix}}-class-suffix-icon">
  38. <slot name="suffix-icon" />
  39. <template
  40. wx:if="{{_suffixIcon}}"
  41. is="icon"
  42. data="{{tClass: prefix + '-class-suffix-icon', ariaHidden: true, ..._suffixIcon }}"
  43. />
  44. </view>
  45. </navigator>