Checkbox add size prop

This commit is contained in:
梁灏 2017-08-24 17:25:21 +08:00
parent 3485243a4d
commit 77f1cc2e34
5 changed files with 99 additions and 7 deletions

View file

@ -22,7 +22,7 @@
</label>
</template>
<script>
import { findComponentUpward } from '../../utils/assist';
import { findComponentUpward, oneOf } from '../../utils/assist';
import Emitter from '../../mixins/emitter';
const prefixCls = 'ivu-checkbox';
@ -53,6 +53,11 @@
indeterminate: {
type: Boolean,
default: false
},
size: {
validator (value) {
return oneOf(value, ['small', 'large', 'default']);
}
}
},
data () {
@ -71,7 +76,8 @@
{
[`${prefixCls}-group-item`]: this.group,
[`${prefixCls}-wrapper-checked`]: this.currentValue,
[`${prefixCls}-wrapper-disabled`]: this.disabled
[`${prefixCls}-wrapper-disabled`]: this.disabled,
[`${prefixCls}-${this.size}`]: !!this.size
}
];
},