Merge branch 'main' of https://github.com/vbenjs/vue-vben-admin
This commit is contained in:
@@ -32,9 +32,13 @@
|
||||
body,
|
||||
html {
|
||||
@apply size-full overscroll-none;
|
||||
|
||||
/* scrollbar-gutter: stable; */
|
||||
}
|
||||
|
||||
body {
|
||||
@apply !pointer-events-auto;
|
||||
|
||||
min-height: 100vh;
|
||||
|
||||
/* overflow: overlay; */
|
||||
@@ -90,6 +94,7 @@
|
||||
}
|
||||
|
||||
/* 只有非mac下才进行调整,mac下使用默认滚动条 */
|
||||
|
||||
html:not([data-platform='macOs']) {
|
||||
::-webkit-scrollbar {
|
||||
@apply h-[10px] w-[10px];
|
||||
|
@@ -71,6 +71,7 @@
|
||||
"dependencies": {
|
||||
"@ctrl/tinycolor": "^4.1.0",
|
||||
"@tanstack/vue-store": "^0.5.5",
|
||||
"@vue/reactivity": "^3.5.4",
|
||||
"@vue/shared": "^3.5.4",
|
||||
"clsx": "^2.1.1",
|
||||
"defu": "^6.1.4",
|
||||
|
@@ -5,6 +5,7 @@ export * from './inference';
|
||||
export * from './letter';
|
||||
export * from './merge';
|
||||
export * from './nprogress';
|
||||
export * from './reactivity';
|
||||
export * from './state-handler';
|
||||
export * from './to';
|
||||
export * from './tree';
|
||||
|
26
packages/@core/base/shared/src/utils/reactivity.ts
Normal file
26
packages/@core/base/shared/src/utils/reactivity.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { isProxy, isReactive, isRef, toRaw } from '@vue/reactivity';
|
||||
|
||||
function deepToRaw<T extends Record<string, any>>(sourceObj: T): T {
|
||||
const objectIterator = (input: any): any => {
|
||||
if (Array.isArray(input)) {
|
||||
return input.map((item) => objectIterator(item));
|
||||
}
|
||||
if (isRef(input) || isReactive(input) || isProxy(input)) {
|
||||
return objectIterator(toRaw(input));
|
||||
}
|
||||
if (input && typeof input === 'object') {
|
||||
const result = {} as T;
|
||||
for (const key in input) {
|
||||
if (Object.prototype.hasOwnProperty.call(input, key)) {
|
||||
result[key as keyof T] = objectIterator(input[key]);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return input;
|
||||
};
|
||||
|
||||
return objectIterator(sourceObj);
|
||||
}
|
||||
|
||||
export { deepToRaw };
|
Reference in New Issue
Block a user