button.wxml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <import src="../common/template/icon.wxml" />
  2. <wxs src="../common/utils.wxs" module="_" />
  3. <button
  4. id="{{tId}}"
  5. style="{{_._style([style, customStyle])}}"
  6. data-custom="{{ customDataset }}"
  7. class="class {{className}}"
  8. form-type="{{disabled || loading ? '' : type}}"
  9. open-type="{{disabled || loading ? '' : openType}}"
  10. hover-stop-propagation="{{hoverStopPropagation}}"
  11. hover-start-time="{{hoverStartTime}}"
  12. hover-stay-time="{{hoverStayTime}}"
  13. lang="{{lang}}"
  14. session-from="{{sessionFrom}}"
  15. hover-class="{{disabled || loading ? '' : (hoverClass || classPrefix + '--hover')}}"
  16. send-message-title="{{sendMessageTitle}}"
  17. send-message-path="{{sendMessagePath}}"
  18. send-message-img="{{sendMessageImg}}"
  19. app-parameter="{{appParameter}}"
  20. show-message-card="{{showMessageCard}}"
  21. catch:tap="handleTap"
  22. bind:getuserinfo="getuserinfo"
  23. bind:contact="contact"
  24. bind:getphonenumber="getphonenumber"
  25. bind:error="error"
  26. bind:opensetting="opensetting"
  27. bind:launchapp="launchapp"
  28. bind:chooseavatar="chooseavatar"
  29. bind:agreeprivacyauthorization="agreeprivacyauthorization"
  30. aria-label="{{ariaLabel}}"
  31. >
  32. <template
  33. wx:if="{{_icon}}"
  34. is="icon"
  35. data="{{tClass: classPrefix + '__icon ' + prefix + '-class-icon', ariaHidden: true, name: iconName, ..._icon}}"
  36. />
  37. <t-loading
  38. wx:if="{{loading}}"
  39. delay="{{loadingProps.delay || 0}}"
  40. duration="{{loadingProps.duration || 800}}"
  41. indicator="{{loadingProps.indicator || true}}"
  42. inheritColor="{{loadingProps.inheritColor || true}}"
  43. layout="{{loadingProps.layout || 'horizontal'}}"
  44. pause="{{loadingProps.pause || false}}"
  45. progress="{{loadingProps.progress || 0}}"
  46. reverse="{{loadingProps.reverse || false}}"
  47. size="{{loadingProps.size || '40rpx'}}"
  48. text="{{loadingProps.text || '' }}"
  49. theme="{{loadingProps.theme || 'circular'}}"
  50. loading
  51. t-class="{{classPrefix}}__loading {{classPrefix}}__loading--wrapper"
  52. t-class-indicator="{{classPrefix}}__loading--indicator {{prefix}}-class-loading"
  53. />
  54. <view class="{{classPrefix}}__content">
  55. <slot name="content" />
  56. <block wx:if="{{content}}">{{content}}</block>
  57. <slot />
  58. </view>
  59. <slot name="suffix" />
  60. </button>