button.wxml 1.6 KB

12345678910111213141516171819202122232425262728293031
  1. <button class="tui-button-class tui-btn {{'tui-btn-'+size}} {{plain?'tui-'+type+'-outline':'tui-'+(type || 'gradual')}} {{parse.getDisabledClass(disabled,type)}} {{parse.getShapeClass(shape,plain)}}" hover-class="{{parse.getHoverClass(disabled,type,plain)}}" loading="{{loading}}"
  2. disabled="{{disabled}}" open-type="{{ openType }}" app-parameter="{{ appParameter }}" hover-stop-propagation="{{ hoverStopPropagation }}" bindtap="handleClick" session-from="{{ sessionFrom }}" send-message-title="{{ sendMessageTitle }}" send-message-path="{{ sendMessagePath }}"
  3. send-message-img="{{ sendMessageImg }}" show-message-card="{{ showMessageCard }}" bindcontact="bindcontact" bindgetuserinfo="bindgetuserinfo" bindgetphonenumber="bindgetphonenumber" binderror="binderror" form-type="{{formType}}" hidden="{{hidden}}">
  4. <slot></slot>
  5. </button>
  6. <wxs module="parse">
  7. module.exports = {
  8. getDisabledClass: function(disabled, type) {
  9. var className = '';
  10. if (disabled && type != 'white' && type != 'gray') {
  11. className = type == 'gradual' ? 'btn-gradual-disabled' : 'tui-dark-disabled';
  12. }
  13. return className;
  14. },
  15. getShapeClass: function(shape, plain) {
  16. var className = '';
  17. if (shape == 'circle') {
  18. className = plain ? 'tui-outline-fillet' : 'tui-fillet';
  19. }
  20. return className;
  21. },
  22. getHoverClass: function(disabled, type, plain) {
  23. var className = '';
  24. if (!disabled) {
  25. className = plain ? 'tui-outline-hover' : ('tui-' + (type || 'gradual') + '-hover');
  26. }
  27. return className;
  28. }
  29. }
  30. </wxs>