From 93a31f29f95ffdcdbca02a0a19fad43a8dff7e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Mon, 26 Apr 2021 16:31:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BE=93=E5=85=A5=E6=A1=86?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/form/input.wc | 5 ++-- src/form/passwd.wc | 65 ++++++++++++++++++++++---------------------- src/form/textarea.wc | 24 ++++++++++------ 3 files changed, 50 insertions(+), 44 deletions(-) diff --git a/src/form/input.wc b/src/form/input.wc index dc7c302..8db13a8 100644 --- a/src/form/input.wc +++ b/src/form/input.wc @@ -612,13 +612,14 @@ export default class Input { break case 'maxlength': - case 'minlength': if (val === null) { this.__INPUT__.removeAttribute(name) } else { let n = +val if (n > 0) { - this.__INPUT__.setAttribute(name, +val) + this.__INPUT__.setAttribute(name, n) + } else { + this.removeAttribute(name) } } break diff --git a/src/form/passwd.wc b/src/form/passwd.wc index 642563e..fc5fa77 100644 --- a/src/form/passwd.wc +++ b/src/form/passwd.wc @@ -93,34 +93,6 @@ li { } } -/* 额外样式 */ -:host([round]) { - border-radius: 26px; - - .label input { - padding: 0 10px; - margin: 0 18px; - } - - .label[prepend] input, - .label[append] input { - padding: 0 5px; - } - .label[prepend] input { - margin-left: 0; - } - .label[append] input { - margin-right: 0; - } - - .prepend { - border-radius: 26px 0 0 26px; - } - .append { - border-radius: 0 26px 26px 0; - } -} - :host([size='large']) { min-width: 234px; .label { @@ -185,6 +157,33 @@ li { } } +/* 额外样式 */ +:host([round]) { + border-radius: 26px; + + .label input { + padding: 0 26px; + } + + .label[prepend] input, + .label[append] input { + padding: 0 5px; + } + .label[prepend] input { + margin-left: 0; + } + .label[append] input { + margin-right: 0; + } + + .prepend { + border-radius: 26px 0 0 26px; + } + .append { + border-radius: 0 26px 26px 0; + } +} + /* ----- 类型(颜色) ----- */ :host(:focus-within) { box-shadow: 0 0 0 2px var(--color-plain-a); @@ -275,7 +274,6 @@ li {