RadioGroup add prop button-style
This commit is contained in:
parent
fb6845f431
commit
b8f4f2a4a3
3 changed files with 25 additions and 1 deletions
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
}
|
||||
];
|
||||
|
|
|
@ -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{
|
||||
|
|
Loading…
Add table
Reference in a new issue