From b96359ca18c97d09ceb4dd9855c71bfbe8be1b45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Tue, 26 Jan 2021 09:56:53 +0800 Subject: [PATCH] Input add border prop --- src/components/input/input.vue | 9 ++++++++- src/styles/mixins/input.less | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/components/input/input.vue b/src/components/input/input.vue index 4928f9dd..da7135bf 100644 --- a/src/components/input/input.vue +++ b/src/components/input/input.vue @@ -190,6 +190,11 @@ password: { type: Boolean, default: false + }, + // 4.5.0 + border: { + type: Boolean, + default: true } }, data () { @@ -250,6 +255,7 @@ { [`${prefixCls}-${this.size}`]: !!this.size, [`${prefixCls}-disabled`]: this.itemDisabled, + [`${prefixCls}-no-border`]: !this.border, [`${prefixCls}-with-prefix`]: this.showPrefix, [`${prefixCls}-with-suffix`]: this.showSuffix || (this.search && this.enterButton === false) } @@ -259,7 +265,8 @@ return [ `${prefixCls}`, { - [`${prefixCls}-disabled`]: this.itemDisabled + [`${prefixCls}-disabled`]: this.itemDisabled, + [`${prefixCls}-no-border`]: !this.border } ]; }, diff --git a/src/styles/mixins/input.less b/src/styles/mixins/input.less index b7520b47..fb624e27 100644 --- a/src/styles/mixins/input.less +++ b/src/styles/mixins/input.less @@ -85,6 +85,24 @@ &-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() {