From 2c858f450161118ad4fe6caeaf094ad456877784 Mon Sep 17 00:00:00 2001 From: fzh <1399952343@qq.com> Date: Mon, 25 Dec 2023 18:24:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8D=E6=95=B0=E5=80=BC?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E5=88=9D=E5=A7=8B=E5=8C=96=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E9=BB=98=E8=AE=A4=E5=80=BC=E4=B8=BA=E7=A9=BA=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=E6=8F=90=E7=A4=BAVue=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 ++++++ src/editor/text-box/ibiz-input-number/ibiz-input-number.tsx | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee20cdc5..cf7e2d8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,10 +7,16 @@ ## [Unreleased] +### Added + - 新增富文本编辑器编辑态和只读态切换功能(enableEdit)、全屏功能(enableFullScreen),均有编辑器参数控制 - 新增滑动输入条编辑器文本显示功能(showText)及显示文本格式(format),均由编辑器参数控制 - 更新看板部件批量操作工具栏打开方式 +### Fixed + +- 修复数值编辑器初始化时,默认值为空字符串提示Vue报错,且错误展示为数字0 + ## [0.5.0-beta.0] - 2023-12-24 ### 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 30a0c005..d2ea797f 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 @@ -5,6 +5,7 @@ import { useNamespace, } from '@ibiz-template/vue3-util'; import './ibiz-input-number.scss'; +import { isNilOrEmpty } from 'qx-util'; import { TextBoxEditorController } from '../text-box-editor.controller'; export const IBizInputNumber = defineComponent({ @@ -16,7 +17,7 @@ export const IBizInputNumber = defineComponent({ const c = props.controller; - const currentVal = ref(''); + const currentVal = ref(null); watch( () => props.value, @@ -77,7 +78,7 @@ export const IBizInputNumber = defineComponent({ let content = null; if (this.readonly) { // 只读显示 - content = `${this.currentVal}`; + content = isNilOrEmpty(this.currentVal) ? '' : `${this.currentVal}`; // 当有值且单位存在时才显示单位 if (content && unitName) { content += unitName; -- Gitee