From 23cf34f78ecc14a05e0b46548c03d1bb4b9c9a91 Mon Sep 17 00:00:00 2001 From: xingyu Date: Thu, 8 Jun 2023 11:01:57 +0800 Subject: [PATCH] fix(deepMerge): fix deepMerge --- src/utils/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/index.ts b/src/utils/index.ts index 898758e6..58b5a38d 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,9 +1,9 @@ -import type { RouteLocationNormalized, RouteRecordNormalized } from 'vue-router' import type { App, Component } from 'vue' +import type { RouteLocationNormalized, RouteRecordNormalized } from 'vue-router' +import { cloneDeep, mergeWith, uniq } from 'lodash-es' import { unref } from 'vue' import { isArray, isObject } from '@/utils/is' -import { cloneDeep, isEqual, mergeWith, unionWith } from 'lodash-es' export const noop = () => {} @@ -45,7 +45,7 @@ export function deepMerge { // 如果是数组,合并数组(去重) If it is an array, merge the array (remove duplicates) - return isArray(prevValue) ? unionWith(prevValue, nextValue, isEqual) : undefined + return isArray(prevValue) ? uniq(prevValue, nextValue) : undefined }) } })