mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-25 02:58:43 +08:00
parent
7dcb38cac6
commit
df0e0cbe69
@ -3,6 +3,7 @@ import type { App, Plugin } from 'vue';
|
||||
|
||||
import { unref } from 'vue';
|
||||
import { isObject } from '/@/utils/is';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
|
||||
export const noop = () => {};
|
||||
|
||||
@ -35,10 +36,11 @@ export function setObjToUrlParams(baseUrl: string, obj: any): string {
|
||||
// 深度合并
|
||||
export function deepMerge<T = any>(src: any = {}, target: any = {}): T {
|
||||
let key: string;
|
||||
const res: any = cloneDeep(src)
|
||||
for (key in target) {
|
||||
src[key] = isObject(src[key]) ? deepMerge(src[key], target[key]) : (src[key] = target[key]);
|
||||
res[key] = isObject(res[key]) ? deepMerge(res[key], target[key]) : (res[key] = target[key]);
|
||||
}
|
||||
return src;
|
||||
return res;
|
||||
}
|
||||
|
||||
export function openWindow(
|
||||
|
Loading…
Reference in New Issue
Block a user