Checkbox add border prop

This commit is contained in:
梁灏 2019-09-15 11:56:37 +08:00
parent e87939165e
commit cea1642e11
3 changed files with 56 additions and 2 deletions

View file

@ -70,6 +70,11 @@
},
name: {
type: String
},
// 4.0.0
border: {
type: Boolean,
default: false
}
},
data () {
@ -90,7 +95,8 @@
[`${prefixCls}-group-item`]: this.group,
[`${prefixCls}-wrapper-checked`]: this.currentValue,
[`${prefixCls}-wrapper-disabled`]: this.disabled,
[`${prefixCls}-${this.size}`]: !!this.size
[`${prefixCls}-${this.size}`]: !!this.size,
[`${prefixCls}-border`]: this.border
}
];
},

View file

@ -91,6 +91,31 @@
cursor: @cursor-disabled;
}
}
&-border{
border: 1px solid @border-color-base;
border-radius: @btn-border-radius;
height: @btn-height-base;
line-height: @btn-height-base - 2px;
padding: @btn-padding-base;
transition: border @transition-time @ease-in-out;
}
&-small&-border, .@{checkbox-prefix-cls}-group.@{checkbox-prefix-cls}-small &-border{
height: @btn-height-small;
line-height: @btn-height-small - 2px;
padding: @btn-padding-small;
}
&-large&-border, .@{checkbox-prefix-cls}-group.@{checkbox-prefix-cls}-large &-border{
height: @btn-height-large;
line-height: @btn-height-large - 4px;
padding: @btn-padding-large;
}
}
.@{checkbox-prefix-cls}-wrapper-checked.@{checkbox-prefix-cls}-border{
border-color: @primary-color;
}
.@{checkbox-prefix-cls}-wrapper-disabled.@{checkbox-prefix-cls}-border{
border-color: @btn-disable-border;
}
// 选中状态