Input add border prop

This commit is contained in:
梁灏 2021-01-26 09:56:53 +08:00
parent 3fde9d0006
commit b96359ca18
2 changed files with 26 additions and 1 deletions

View file

@ -190,6 +190,11 @@
password: { password: {
type: Boolean, type: Boolean,
default: false default: false
},
// 4.5.0
border: {
type: Boolean,
default: true
} }
}, },
data () { data () {
@ -250,6 +255,7 @@
{ {
[`${prefixCls}-${this.size}`]: !!this.size, [`${prefixCls}-${this.size}`]: !!this.size,
[`${prefixCls}-disabled`]: this.itemDisabled, [`${prefixCls}-disabled`]: this.itemDisabled,
[`${prefixCls}-no-border`]: !this.border,
[`${prefixCls}-with-prefix`]: this.showPrefix, [`${prefixCls}-with-prefix`]: this.showPrefix,
[`${prefixCls}-with-suffix`]: this.showSuffix || (this.search && this.enterButton === false) [`${prefixCls}-with-suffix`]: this.showSuffix || (this.search && this.enterButton === false)
} }
@ -259,7 +265,8 @@
return [ return [
`${prefixCls}`, `${prefixCls}`,
{ {
[`${prefixCls}-disabled`]: this.itemDisabled [`${prefixCls}-disabled`]: this.itemDisabled,
[`${prefixCls}-no-border`]: !this.border
} }
]; ];
}, },

View file

@ -85,6 +85,24 @@
&-small { &-small {
.input-small(); .input-small();
} }
&-no-border{
border-radius: 0;
border-color: transparent;
&:hover{
border-color: transparent;
}
&:focus{
border-color: transparent;
box-shadow: none;
}
&[disabled]{
background-color: transparent;
&:hover {
border-color: transparent;
}
}
}
} }
.input-error() { .input-error() {