button.wxml 2.0 KB

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