1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 14:08:06 +08:00

feat: 优化缓存二级路由方式 (#6944)

This commit is contained in:
zhengkunwang 2024-11-04 18:56:17 +08:00 committed by GitHub
parent eab475a631
commit b31ed9b920
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 24 additions and 4 deletions

View File

@ -53,6 +53,10 @@ const props = defineProps({
type: Number,
default: 0,
},
height: {
type: Number,
default: 0,
},
});
const emit = defineEmits(['search', 'update:selects', 'update:paginationConfig']);
const globalStore = GlobalStore();
@ -105,11 +109,19 @@ onMounted(() => {
if (props.heightDiff) {
heightDiff = props.heightDiff;
}
if (props.height) {
tableHeight.value = props.height;
} else {
tableHeight.value = window.innerHeight - heightDiff;
}
window.onresize = () => {
return (() => {
if (props.height) {
tableHeight.value = props.height;
} else {
tableHeight.value = window.innerHeight - heightDiff;
}
})();
};
});

View File

@ -19,7 +19,7 @@
</div>
<div class="content-container__main" v-if="slots.main">
<el-card>
<div class="content-container__title" v-if="title">
<div class="content-container__title">
<slot name="title">
<div v-if="showBack">
<div class="flex justify-between">

View File

@ -56,8 +56,15 @@ router.beforeEach((to, from, next) => {
router.afterEach((to) => {
if (to.meta.activeMenu && !isRedirecting) {
let notMathParam = true;
if (to.matched.some((record) => record.path.includes(':'))) {
notMathParam = false;
}
if (notMathParam) {
localStorage.setItem('cachedRoute' + to.meta.activeMenu, to.path);
}
}
isRedirecting = false;
NProgress.done();
});

View File

@ -45,6 +45,7 @@ const webSiteRouter = {
component: () => import('@/views/website/runtime/php/index.vue'),
meta: {
title: 'menu.runtime',
activeMenu: '/websites/runtimes/php',
requiresAuth: false,
},
},