ludens blunt
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
2 deletions
-
src/utils/index.ts
|
|
|
@ -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( |
|
|
|
|