123456789101112131415161718192021222324252627282930313233343536373839 |
- <button class="tui-btn-class tui-btn {{plain?'tui-'+type+'-outline':'tui-btn-'+(type || 'primary')}} {{wxs.getDisabledClass(disabled,type)}} {{wxs.getShapeClass(shape,plain)}} {{wxs.getShadowClass(type,shadow,plain)}}" hover-class="{{wxs.getHoverClass(disabled,type,plain)}}"
- style="width:{{width}};height:{{height}};line-height:{{height}};font-size:{{size}}rpx" loading="{{loading}}" disabled="{{disabled}}" bindtap="handleClick">
- <slot></slot>
- </button>
- <wxs module="wxs">
- module.exports = {
- getShadowClass: function(type, shadow, plain) {
- var className = '';
- if (shadow && type != 'white' && !plain) {
- className = 'tui-shadow-' + type;
- }
- return className;
- },
- getDisabledClass: function(disabled, type) {
- var className = '';
- if (disabled && type != 'white' && type != 'gray') {
- className = 'tui-dark-disabled';
- }
- return className;
- },
- getShapeClass: function(shape, plain) {
- var className = '';
- if (shape == 'circle') {
- className = plain ? 'tui-outline-fillet' : 'tui-fillet';
- } else if (shape == "rightAngle") {
- className = plain ? 'tui-outline-rightAngle' : 'tui-rightAngle';
- }
- return className;
- },
- getHoverClass: function(disabled, type, plain) {
- var className = '';
- if (!disabled) {
- className = plain ? 'tui-outline-hover' : ('tui-' + (type || 'primary') + '-hover');
- }
- return className;
- }
- }
- </wxs>
|