From 9c363ca33a295d446def47ff5eb899c6705fc62e Mon Sep 17 00:00:00 2001 From: zhf <1204297681@qq.com> Date: Thu, 18 Jan 2024 19:08:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dinput-number=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=B8=85=E7=A9=BA=E5=80=BC=E6=97=B6=E6=9C=AA=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E5=80=BC=E5=8F=98=E6=9B=B4=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ src/editor/text-box/ibiz-input-number/ibiz-input-number.tsx | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e9000b9c..03b40e761 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ - 下拉列表支持值项配置[注意: 配置值项后抛给绑定编辑器的值是文本,抛给值项的值为标识] +### Fixed + +- 修复input-number组件清空值时未触发值变更异常 + ## [0.5.3-beta.10] - 2024-01-18 ### Added diff --git a/src/editor/text-box/ibiz-input-number/ibiz-input-number.tsx b/src/editor/text-box/ibiz-input-number/ibiz-input-number.tsx index 15ed080f3..cb7ea662e 100644 --- a/src/editor/text-box/ibiz-input-number/ibiz-input-number.tsx +++ b/src/editor/text-box/ibiz-input-number/ibiz-input-number.tsx @@ -53,7 +53,7 @@ export const IBizInputNumber = defineComponent({ () => props.value, (newVal, oldVal) => { if (newVal !== oldVal) { - const number = Number(newVal); + const number = newVal != null ? Number(newVal) : ''; currentVal.value = Number.isNaN(number) ? '' : number; } }, @@ -134,7 +134,7 @@ export const IBizInputNumber = defineComponent({