Switch support Form's disabled
This commit is contained in:
parent
75685898a5
commit
763f08da5a
1 changed files with 4 additions and 3 deletions
|
@ -16,12 +16,13 @@
|
|||
<script>
|
||||
import { oneOf } from '../../utils/assist';
|
||||
import Emitter from '../../mixins/emitter';
|
||||
import mixinsForm from '../../mixins/form';
|
||||
|
||||
const prefixCls = 'ivu-switch';
|
||||
|
||||
export default {
|
||||
name: 'iSwitch',
|
||||
mixins: [ Emitter ],
|
||||
mixins: [ Emitter, mixinsForm ],
|
||||
props: {
|
||||
value: {
|
||||
type: [String, Number, Boolean],
|
||||
|
@ -73,7 +74,7 @@
|
|||
`${prefixCls}`,
|
||||
{
|
||||
[`${prefixCls}-checked`]: this.currentValue === this.trueValue,
|
||||
[`${prefixCls}-disabled`]: this.disabled,
|
||||
[`${prefixCls}-disabled`]: this.itemDisabled,
|
||||
[`${prefixCls}-${this.size}`]: !!this.size,
|
||||
[`${prefixCls}-loading`]: this.loading,
|
||||
}
|
||||
|
@ -107,7 +108,7 @@
|
|||
},
|
||||
toggle (event) {
|
||||
event.preventDefault();
|
||||
if (this.disabled || this.loading) {
|
||||
if (this.itemDisabled || this.loading) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue