| | |
| | | this.methods = { |
| | | setClass() { |
| | | const { classPrefix } = this.data; |
| | | const { size, variant, disabled, checked } = this.properties; |
| | | const { size, variant, disabled, checked, shape } = this.properties; |
| | | const tagClass = [ |
| | | classPrefix, |
| | | `${classPrefix}--checkable`, |
| | |
| | | `${classPrefix}--${checked ? 'primary' : 'default'}`, |
| | | `${classPrefix}--${size}`, |
| | | `${classPrefix}--${variant}`, |
| | | `${classPrefix}--${shape}`, |
| | | ]; |
| | | const className = classNames(tagClass); |
| | | this.setData({ |
| | |
| | | this._trigger('click'); |
| | | this._trigger('change', { checked: !checked }); |
| | | }, |
| | | onClose(e) { |
| | | if (this.data.disabled) |
| | | return; |
| | | this._trigger('close', e); |
| | | }, |
| | | }; |
| | | } |
| | | }; |