mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 14:13:40 +08:00
chore: fix types
This commit is contained in:
16
src/hooks/core/useEffect.ts
Normal file
16
src/hooks/core/useEffect.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { WatchOptions } from 'vue';
|
||||
import { watch } from 'vue';
|
||||
import { isFunction } from '/@/utils/is';
|
||||
|
||||
export const useEffect = (effectHandler: Fn, dependencies: any[]) => {
|
||||
return watch(
|
||||
dependencies,
|
||||
(changedDependencies, prevDependencies, onCleanUp) => {
|
||||
const effectCleaner = effectHandler(changedDependencies, prevDependencies);
|
||||
if (isFunction(effectCleaner)) {
|
||||
onCleanUp(effectCleaner);
|
||||
}
|
||||
},
|
||||
{ immediate: true, deep: true } as WatchOptions
|
||||
);
|
||||
};
|
@@ -27,7 +27,7 @@
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
|
||||
import { useRootSetting } from '/@/hooks/setting/useRootSetting';
|
||||
import { updateColorWeak, updateGrayMode } from '/@/setup/theme';
|
||||
import { updateColorWeak, updateGrayMode } from '/@/logics/theme';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'SettingFooter',
|
||||
|
@@ -4,7 +4,7 @@ import {
|
||||
updateGrayMode,
|
||||
updateHeaderBgColor,
|
||||
updateSidebarBgColor,
|
||||
} from '/@/setup/theme';
|
||||
} from '/@/logics/theme';
|
||||
import { appStore } from '/@/store/modules/app';
|
||||
import { ProjectConfig } from '/@/types/config';
|
||||
|
||||
|
@@ -23,7 +23,5 @@ export function listenerLastChangeTab(
|
||||
immediate = true
|
||||
) {
|
||||
mitt.on(key, callback);
|
||||
if (immediate) {
|
||||
callback(lastChangeTab);
|
||||
}
|
||||
immediate && callback(lastChangeTab);
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ function toggleClass(flag: boolean, clsName: string, target?: HTMLElement) {
|
||||
|
||||
/**
|
||||
* Change the status of the project's color weakness mode
|
||||
* @param gray
|
||||
* @param colorWeak
|
||||
*/
|
||||
export const updateColorWeak = (colorWeak: boolean) => {
|
||||
toggleClass(colorWeak, 'color-weak', document.documentElement);
|
3
src/router/types.d.ts
vendored
3
src/router/types.d.ts
vendored
@@ -14,7 +14,8 @@ export interface RouteMeta {
|
||||
affix?: boolean;
|
||||
// icon on tab
|
||||
icon?: string;
|
||||
// Jump address
|
||||
|
||||
frameSrc?: string;
|
||||
|
||||
// current page transition
|
||||
transitionName?: string;
|
||||
|
@@ -17,7 +17,7 @@ import {
|
||||
updateColorWeak,
|
||||
updateHeaderBgColor,
|
||||
updateSidebarBgColor,
|
||||
} from '/@/setup/theme';
|
||||
} from '/@/logics/theme';
|
||||
|
||||
import { appStore } from '/@/store/modules/app';
|
||||
import { deepMerge } from '/@/utils';
|
||||
|
Reference in New Issue
Block a user