diff --git a/src/editor/span/span/span.tsx b/src/editor/span/span/span.tsx index 4a1734e30e376f2bb8de8424cf7f938f8f201dcb..8c21f05eee6fdad18ef9c2305c69b240c1d7c1c8 100644 --- a/src/editor/span/span/span.tsx +++ b/src/editor/span/span/span.tsx @@ -4,7 +4,6 @@ import { useFocusAndBlur, useNamespace, } from '@ibiz-template/vue3-util'; -import dayjs from 'dayjs'; import './span.scss'; import { CodeListItem } from '@ibiz-template/runtime'; import { isNil } from 'ramda'; @@ -31,7 +30,15 @@ export const IBizSpan = defineComponent({ return; } if (c.parent.valueFormat) { - text.value = dayjs(newVal).format(c.parent.valueFormat); + try { + text.value = ibiz.util.text.format( + `${newVal}`, + c.parent.valueFormat, + ); + } catch (error) { + text.value = `${newVal}`; + ibiz.log.error(`${newVal} 值格式化错误`); + } } else { text.value = newVal ? `${newVal}` : ''; }