From bbf0409262df0c8a7d88d5031b3aa7cd4f8fe0da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E5=84=80=E5=BC=8F?= <854085467@qq.com> Date: Fri, 4 Nov 2022 01:08:58 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(input):=20=E6=96=B0=E5=A2=9E=20max=20?= =?UTF-8?q?=E4=B8=8E=20min=20=E5=B1=9E=E6=80=A7,=20=E7=94=A8=E4=BA=8E?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=20type=3Dnumber=20=E4=B8=8B=E7=9A=84?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E5=80=BC=E4=B8=8E=E6=9C=80=E5=B0=8F=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/component/src/component/input/index.vue | 4 ++++ package/component/src/component/inputNumber/index.vue | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package/component/src/component/input/index.vue b/package/component/src/component/input/index.vue index c455b521..8a002516 100644 --- a/package/component/src/component/input/index.vue +++ b/package/component/src/component/input/index.vue @@ -27,6 +27,8 @@ export interface InputProps { password?: boolean; size?: InputSize; maxlength?: number; + max?: number; + min?: number; } const props = withDefaults(defineProps(), { @@ -159,6 +161,8 @@ const showPassword = () => { :autofocus="autofocus" :autocomplete="autocomplete" :maxlength="maxlength" + :max="max" + :min="min" :readonly="readonly" @input="onInput" @change="onChange" diff --git a/package/component/src/component/inputNumber/index.vue b/package/component/src/component/inputNumber/index.vue index 3aca4e92..9b2fb340 100644 --- a/package/component/src/component/inputNumber/index.vue +++ b/package/component/src/component/inputNumber/index.vue @@ -135,11 +135,13 @@ const isNumber = function (num: any) {