RadioGroup add prop button-style

This commit is contained in:
梁灏 2021-01-14 17:50:43 +08:00
parent fb6845f431
commit b8f4f2a4a3
3 changed files with 25 additions and 1 deletions

View file

@ -22,12 +22,18 @@
<span>Windows</span>
</Radio>
</Radio-group>
<Radio-group v-model="button2" type="button" size="large">
<Radio-group v-model="button2" type="button" size="large" button-style="solid">
<Radio label="北京"></Radio>
<Radio label="上海" disabled></Radio>
<Radio label="深圳"></Radio>
<Radio label="杭州"></Radio>
</Radio-group>
<Radio-group v-model="button2" type="button" size="large">
<Radio label="北京"></Radio>
<Radio label="上海"></Radio>
<Radio label="深圳"></Radio>
<Radio label="杭州"></Radio>
</Radio-group>
<Radio-group v-model="button2" type="button" size="default">
<Radio label="北京"></Radio>
<Radio label="上海" disabled></Radio>

View file

@ -41,6 +41,13 @@
name: {
type: String,
default: getUuid
},
// 4.5.0
buttonStyle: {
validator (value) {
return oneOf(value, ['default', 'solid']);
},
default: 'default'
}
},
data () {
@ -57,6 +64,7 @@
[`${prefixCls}-${this.size}`]: !!this.size,
[`ivu-radio-${this.size}`]: !!this.size,
[`${prefixCls}-${this.type}`]: !!this.type,
[`${prefixCls}-button-${this.buttonStyle}`]: this.type === 'button' && this.buttonStyle !== 'default',
[`${prefixCls}-vertical`]: this.vertical
}
];

View file

@ -338,6 +338,16 @@ span.@{radio-prefix-cls} + * {
box-shadow: none!important;
}
}
&-solid .@{radio-prefix-cls}-wrapper{
&-checked:not(.@{radio-prefix-cls}-wrapper-disabled){
background: @primary-color;
color: #fff;
&:hover{
background: tint(@primary-color, 20%);
color: #fff;
}
}
}
}
.@{radio-group-button-prefix-cls}.@{radio-group-prefix-cls}-large .@{radio-prefix-cls}-wrapper{