diff --git a/src/form/number.js b/src/form/number.js index 37e332b..50bbac6 100644 --- a/src/form/number.js +++ b/src/form/number.js @@ -106,39 +106,13 @@ class InputNumber extends Component { `, // 尺寸 css` - @use 'sass:map'; - $sizes: ( - s: ( - w: 52px, - h: 20px, - f: 12px - ), - m: ( - w: 72px, - h: 24px, - f: 12px - ), - xl: ( - w: 132px, - h: 36px, - f: 14px - ), - xxl: ( - w: 160px, - h: 44px, - f: 16px - ) - ); + :host([size='small']) { + min-width: 72px; + height: 24px; + font-size: 12px; - @loop $s, $v in $sizes { - :host([size='#{$s}']) { - min-width: map.get($v, 'w'); - height: map.get($v, 'h'); - font-size: map.get($v, 'f'); - - button { - width: map.get($v, 'h') + 2; - } + button { + width: 26px; } } @@ -160,9 +134,7 @@ class InputNumber extends Component { info: 'blue', success: 'green', warning: 'orange', - danger: 'red', - secondary: 'dark', - help: 'grey' + danger: 'red' ); @loop $t, $c in $colors { @@ -225,7 +197,17 @@ class InputNumber extends Component { } #fetch(value) { + let now = Date.now() + let { lazy } = this this.value = value + + // 并发拦截 + if (lazy && now - this.#stamp < lazy) { + return + } + + this.#stamp = now + this.$emit('input') this.$emit('change') }