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:
parent
eab475a631
commit
b31ed9b920
@ -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;
|
||||
}
|
||||
|
||||
tableHeight.value = window.innerHeight - heightDiff;
|
||||
window.onresize = () => {
|
||||
return (() => {
|
||||
tableHeight.value = window.innerHeight - heightDiff;
|
||||
if (props.height) {
|
||||
tableHeight.value = props.height;
|
||||
} else {
|
||||
tableHeight.value = window.innerHeight - heightDiff;
|
||||
}
|
||||
})();
|
||||
};
|
||||
});
|
||||
|
@ -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">
|
||||
|
@ -56,8 +56,15 @@ router.beforeEach((to, from, next) => {
|
||||
|
||||
router.afterEach((to) => {
|
||||
if (to.meta.activeMenu && !isRedirecting) {
|
||||
localStorage.setItem('cachedRoute' + to.meta.activeMenu, to.path);
|
||||
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();
|
||||
});
|
||||
|
@ -45,6 +45,7 @@ const webSiteRouter = {
|
||||
component: () => import('@/views/website/runtime/php/index.vue'),
|
||||
meta: {
|
||||
title: 'menu.runtime',
|
||||
activeMenu: '/websites/runtimes/php',
|
||||
requiresAuth: false,
|
||||
},
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user