Skip to content

Commit

Permalink
feat(layouts): ✨ [layouts] 清空缓存回到登录页
Browse files Browse the repository at this point in the history
  • Loading branch information
jsxiaosi committed Oct 27, 2022
1 parent 8eadfcf commit 701bf06
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/layouts/pageLayouts/components/Seting/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pageSettings from './pageSettings/index.vue';
import { useAppStoreHook } from '@/store/modules/app';
import type { SidebarMode } from '@/store/types';
import { clearStorage } from '@/utils/storage';
const props = defineProps({
modelValue: {
Expand Down Expand Up @@ -45,6 +46,11 @@
const handerShowElmenu = (vale: SidebarMode) => {
appStore.setAppConfigMode({ sidebarMode: vale });
};
const handerClearStorage = () => {
clearStorage();
window.location.reload();
};
</script>

<template>
Expand Down Expand Up @@ -85,6 +91,9 @@
<div>
<pageSettings></pageSettings>
</div>
<el-button class="clear_storage" type="danger" @click="handerClearStorage">{{
$t('layout.clearStorage')
}}</el-button>
</div>
</el-drawer>
</div>
Expand All @@ -97,6 +106,9 @@
.drawer-content {
width: 100%;
height: 100%;
overflow-y: auto;
position: relative;
.layout_seting {
.sidebar_seting {
display: flex;
Expand Down Expand Up @@ -173,5 +185,10 @@
:deep(.el-divider__text) {
text-align: center;
}
.clear_storage {
margin-top: 24px;
width: 100%;
}
}
</style>
1 change: 1 addition & 0 deletions src/locales/en/modules/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const layout = {
pageSettings: 'Page Settings',
hideTabs: 'Hide Tabs',
labelPersistent: 'Label Persistent',
clearStorage: 'Clear cache and return to login page',
};

export default layout;
1 change: 1 addition & 0 deletions src/locales/zh-ch/modules/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const layout = {
pageSettings: '页面设置',
hideTabs: '隐藏标签页',
labelPersistent: '标签持久化',
clearStorage: '清空缓存回到登录页',
};

export default layout;

0 comments on commit 701bf06

Please sign in to comment.