From 53e5cc7afb1af484c8e446db3e03885bb77b5248 Mon Sep 17 00:00:00 2001 From: cycleccc <2991205548@qq.com> Date: Tue, 26 Nov 2024 17:54:26 +0800 Subject: [PATCH] perf: replace substr with splice (#8882) --- packages/utils/src/components/FieldLabel/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/utils/src/components/FieldLabel/index.tsx b/packages/utils/src/components/FieldLabel/index.tsx index 39cd1ef2d39e..684707951f57 100644 --- a/packages/utils/src/components/FieldLabel/index.tsx +++ b/packages/utils/src/components/FieldLabel/index.tsx @@ -157,7 +157,7 @@ const FieldLabelFunction: React.ForwardRefRenderFunction< {prefix} {typeof str === 'string' - ? str?.toString()?.substr?.(0, valueMaxLength) + ? str?.toString()?.slice?.(0, valueMaxLength) : str} {tail}