Radio add size prop

This commit is contained in:
梁灏 2017-08-24 17:50:30 +08:00
parent 77f1cc2e34
commit 4d54542083
5 changed files with 73 additions and 21 deletions

View file

@ -12,7 +12,7 @@
</label>
</template>
<script>
import { findComponentUpward } from '../../utils/assist';
import { findComponentUpward, oneOf } from '../../utils/assist';
import Emitter from '../../mixins/emitter';
const prefixCls = 'ivu-radio';
@ -39,6 +39,11 @@
disabled: {
type: Boolean,
default: false
},
size: {
validator (value) {
return oneOf(value, ['small', 'large', 'default']);
}
}
},
data () {
@ -55,7 +60,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
}
];
},