diff --git a/CHANGELOG.md b/CHANGELOG.md index ee20cdc569eaa432ae773b0bd3b39c4138c0f1bf..cf7e2d8f13ff6f58cd0a85f257b597d0d745f3d6 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 30a0c0053d0520c4147c8b96aeffa53e29d5c38c..d2ea797fe78bb23f6540945e0353d8ec54952798 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;