feat: 内容区添加全局Stretch配置,可自定义紧凑页面,轻松找到所需信息 (#968)

* chore: 页面添加stretch配置
This commit is contained in:
Leet
2024-03-14 10:09:51 +08:00
committed by GitHub
parent 0be8c963ba
commit 359ccdd85b
6 changed files with 107 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import Footer from "./footer/index.vue";
import { useGlobal } from "@pureadmin/utils";
import { useGlobal, isNumber } from "@pureadmin/utils";
import KeepAliveFrame from "./keepAliveFrame/index.vue";
import backTop from "@/assets/svg/back_top.svg?component";
import { h, computed, Transition, defineComponent } from "vue";
@@ -30,10 +30,22 @@ const hideFooter = computed(() => {
return $storage?.configure.hideFooter;
});
const stretch = computed(() => {
return $storage?.configure.stretch;
});
const layout = computed(() => {
return $storage?.layout.layout === "vertical";
});
const getMainWidth = computed(() => {
return isNumber(stretch.value)
? stretch.value + "px"
: stretch.value
? "1440px"
: "100%";
});
const getSectionStyle = computed(() => {
return [
hideTabs.value && layout ? "padding-top: 48px;" : "",
@@ -96,7 +108,10 @@ const transitionMain = defineComponent({
v-if="props.fixedHeader"
:wrap-style="{
display: 'flex',
'flex-wrap': 'wrap'
'flex-wrap': 'wrap',
'max-width': getMainWidth,
margin: '0 auto',
transition: 'all 300ms cubic-bezier(0.4, 0, 0.2, 1)'
}"
:view-style="{
display: 'flex',