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 {