refactor: setting

This commit is contained in:
lrl
2021-11-09 19:24:55 +08:00
parent 782cea9995
commit e98dee9f0a
9 changed files with 85 additions and 70 deletions

View File

@@ -17,6 +17,8 @@ const props = defineProps({
const keepAlive: Boolean = ref(
getCurrentInstance().appContext.config.globalProperties.$config?.KeepAlive
);
const instance =
getCurrentInstance().appContext.app.config.globalProperties.$storage;
const transitions = computed(() => {
return route => {
@@ -24,6 +26,13 @@ const transitions = computed(() => {
};
});
const hideTabs = computed(() => {
return instance?.sets.hideTabs;
});
const layout = computed(() => {
return instance?.layout.layout === "vertical";
});
const transitionMain = defineComponent({
render() {
return h(
@@ -62,6 +71,12 @@ const transitionMain = defineComponent({
<template>
<section
:class="[props.fixedHeader ? 'app-main' : 'app-main-nofixed-header']"
:style="[
hideTabs && layout ? 'padding-top: 48px;' : '',
!hideTabs && layout ? 'padding-top: 85px;' : '',
hideTabs && !layout ? 'padding-top: 62px' : '',
!hideTabs && !layout ? 'padding-top: 98px;' : ''
]"
>
<router-view>
<template #default="{ Component, route }">