Skip to content

Commit ba5b8f8

Browse files
perf(util): remove handleInputNumberValue (#3806)
* perf(util): remove handleInputNumberValue * fix: remove unuse fn
1 parent 08a1f7b commit ba5b8f8

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

src/components/Form/src/helper.ts

+1-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Rule as ValidationRule } from 'ant-design-vue/lib/form/interface';
22
import type { ComponentType } from './types';
33
import { useI18n } from '@/hooks/web/useI18n';
44
import { dateUtil } from '@/utils/dateUtil';
5-
import { isNumber, isObject } from '@/utils/is';
5+
import { isObject } from '@/utils/is';
66

77
const { t } = useI18n();
88

@@ -69,14 +69,6 @@ export const defaultValueComponents = [
6969
'InputTextArea',
7070
];
7171

72-
export function handleInputNumberValue(component?: ComponentType, val?: any) {
73-
if (!component) return val;
74-
if (defaultValueComponents.includes(component)) {
75-
return val && isNumber(val) ? val : `${val}`;
76-
}
77-
return val;
78-
}
79-
8072
/**
8173
* 时间字段
8274
*/

src/components/Form/src/hooks/useFormEvents.ts

-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { isArray, isFunction, isObject, isString, isDef, isNil } from '@/utils/i
66
import { deepMerge } from '@/utils';
77
import {
88
dateItemType,
9-
handleInputNumberValue,
109
defaultValueComponents,
1110
isIncludeSimpleComponents,
1211
} from '../helper';
@@ -79,8 +78,6 @@ export function useFormEvents({
7978
const schema = unref(getSchema).find((item) => item.field === key);
8079
let value = get(values, key);
8180
const hasKey = has(values, key);
82-
83-
value = handleInputNumberValue(schema?.component, value);
8481
const { componentProps } = schema || {};
8582
let _props = componentProps as any;
8683
if (typeof componentProps === 'function') {

0 commit comments

Comments
 (0)