From c0007c33dc8bc32a55f479a3a4ff47db59332e31 Mon Sep 17 00:00:00 2001 From: Gap Zhang Date: Wed, 17 Apr 2024 17:55:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20lodash=20=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E4=B8=BA=20lodash-es=20=E5=90=8E=E9=81=97=E6=BC=8F?= =?UTF-8?q?=E7=9A=84=E9=94=99=E8=AF=AF=E4=BB=A3=E7=A0=81=20(#2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pnpm-lock.yaml | 2 +- src/hooks/app/useFormCurd.ts | 2 +- src/hooks/modules/useForm.ts | 4 ++-- src/utils/index.ts | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3826e23..e45dc53 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6354,4 +6354,4 @@ packages: resolution: {integrity: sha512-O3MilSi/9mwoovx77m6ROZM7sXShR/O/JIanvzTwjN3FORfLSr81PsUGd7jlaYOeds9d8tw82oP44+3YucVo+w==} dependencies: tslib: 2.3.0 - dev: false + dev: false \ No newline at end of file diff --git a/src/hooks/app/useFormCurd.ts b/src/hooks/app/useFormCurd.ts index f6dd6d5..b96ef4c 100644 --- a/src/hooks/app/useFormCurd.ts +++ b/src/hooks/app/useFormCurd.ts @@ -1,7 +1,7 @@ import { reactive, computed, ref, type Ref } from 'vue' import { useRoute, useRouter } from 'vue-router' import { Modal, Message, type FormInstance } from '@arco-design/web-vue' -import { isEqual } from 'lodash' +import { isEqual } from 'lodash-es' type Option = { key?: string diff --git a/src/hooks/modules/useForm.ts b/src/hooks/modules/useForm.ts index 5c1728a..fbf2ac5 100644 --- a/src/hooks/modules/useForm.ts +++ b/src/hooks/modules/useForm.ts @@ -1,8 +1,8 @@ import { reactive } from 'vue' -import _ from 'lodash' +import { cloneDeep } from 'lodash-es' export function useForm(initValue: F) { - const getInitValue = () => _.cloneDeep(initValue) + const getInitValue = () => cloneDeep(initValue) const form = reactive(getInitValue()) diff --git a/src/utils/index.ts b/src/utils/index.ts index d7dfcc6..6262d31 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,6 +1,6 @@ import { isExternal } from '@/utils/validate' import { browse, mapTree } from 'xe-utils' -import _ from 'lodash' +import { upperFirst, camelCase } from 'lodash-es' import { Message } from '@arco-design/web-vue' export function getProperty(obj: T, key: K): T[K] { @@ -184,7 +184,7 @@ export const randomHex = () => { export const transformPathToName = (path: string) => { if (!path) return '' if (isExternal(path)) return '' - return _.upperFirst(_.camelCase(path)) + return upperFirst(camelCase(path)) } /**