Skip to content

Commit

Permalink
refactor(projects): 代码优化
Browse files Browse the repository at this point in the history
ISSUES CLOSED: \
  • Loading branch information
honghuangdc committed May 18, 2022
1 parent 4b80a66 commit 44ab55d
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 108 deletions.
4 changes: 1 addition & 3 deletions src/hooks/common/index.ts
Expand Up @@ -3,7 +3,5 @@ import useBoolean from './useBoolean';
import useLoading from './useLoading';
import useLoadingEmpty from './useLoadingEmpty';
import useReload from './useReload';
import useBodyScroll from './useBodyScroll';
import useModalVisible from './useModalVisible';

export { useContext, useBoolean, useLoading, useLoadingEmpty, useReload, useBodyScroll, useModalVisible };
export { useContext, useBoolean, useLoading, useLoadingEmpty, useReload };
47 changes: 0 additions & 47 deletions src/hooks/common/useBodyScroll.ts

This file was deleted.

33 changes: 0 additions & 33 deletions src/hooks/common/useModalVisible.ts

This file was deleted.

1 change: 1 addition & 0 deletions src/store/modules/route/index.ts
Expand Up @@ -43,6 +43,7 @@ export const useRouteStore = defineStore('route-store', {
cacheRoutes: []
}),
actions: {
/** 重置路由的store */
resetRouteStore() {
this.resetRoutes();
this.$reset();
Expand Down
3 changes: 2 additions & 1 deletion src/store/modules/theme/index.ts
Expand Up @@ -16,6 +16,7 @@ export const useThemeStore = defineStore('theme-store', {
naiveTheme(state) {
return state.darkMode ? darkTheme : undefined;
},
/** 页面动画模式 */
pageAnimateMode(state) {
return state.page.animate ? state.page.animateMode : undefined;
}
Expand All @@ -34,7 +35,7 @@ export const useThemeStore = defineStore('theme-store', {
this.followSystemTheme = visible;
},
/** 自动跟随系统主题 */
autoFollowSystemMode(darkMode: boolean) {
setAutoFollowSystemMode(darkMode: boolean) {
if (this.followSystemTheme) {
this.darkMode = darkMode;
}
Expand Down
21 changes: 0 additions & 21 deletions src/store/subscribe/app.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/store/subscribe/index.ts
@@ -1,8 +1,6 @@
// import subscribeAppStore from './app';
import subscribeThemeStore from './theme';

/** 订阅状态 */
export function subscribeStore() {
// subscribeAppStore();
subscribeThemeStore();
}
2 changes: 1 addition & 1 deletion src/store/subscribe/theme.ts
Expand Up @@ -53,7 +53,7 @@ export default function subscribeThemeStore() {
osTheme,
newValue => {
const isDark = newValue === 'dark';
theme.autoFollowSystemMode(isDark);
theme.setAutoFollowSystemMode(isDark);
},
{ immediate: true }
);
Expand Down

0 comments on commit 44ab55d

Please sign in to comment.