UNPKG

@fmdevui/fm-dev

Version:

Page level components developed based on Element Plus.

85 lines (82 loc) 3.39 kB
import { defineComponent, ref, computed, onMounted, resolveComponent, createBlock, openBlock, normalizeStyle, withCtx, createVNode, createCommentVNode, unref } from 'vue'; import { useRoute } from 'vue-router'; import { storeToRefs } from 'pinia'; import '../../stores/index.mjs'; import { NextLoading } from '../../ui/loading/index.mjs'; import '../routerView/parent.vue.mjs'; import '../footer/index.vue.mjs'; import _sfc_main$1 from '../routerView/parent.vue2.mjs'; import _sfc_main$2 from '../footer/index.vue2.mjs'; import { useTagsViewRoutes } from '../../stores/tagsViewRoutes.mjs'; import { useThemeConfig } from '../../stores/themeConfig.mjs'; var _sfc_main = /* @__PURE__ */ defineComponent({ __name: "main", setup(__props, { expose: __expose }) { const LayoutParentView = _sfc_main$1; const LayoutFooter = _sfc_main$2; const layoutMainScrollbarRef = ref(); const route = useRoute(); const storesTagsViewRoutes = useTagsViewRoutes(); const storesThemeConfig = useThemeConfig(); const { themeConfig } = storeToRefs(storesThemeConfig); const { isTagsViewCurrenFull } = storeToRefs(storesTagsViewRoutes); const isFooter = computed(() => { return themeConfig.value.isFooter && !route.meta.isIframe; }); const isFixedHeader = computed(() => { return themeConfig.value.isFixedHeader; }); const setBacktopClass = computed(() => { if (themeConfig.value.isFixedHeader) return `.layout-backtop-header-fixed .el-scrollbar__wrap`; else return `.layout-backtop .el-scrollbar__wrap`; }); const setMainHeight = computed(() => { if (isTagsViewCurrenFull.value) return "0px"; const { isTagsview, layout } = themeConfig.value; if (isTagsview && layout !== "classic") return "85px"; else return "51px"; }); onMounted(() => { NextLoading.done(600); }); __expose({ layoutMainScrollbarRef }); return (_ctx, _cache) => { const _component_el_scrollbar = resolveComponent("el-scrollbar"); const _component_el_backtop = resolveComponent("el-backtop"); const _component_el_main = resolveComponent("el-main"); return openBlock(), createBlock(_component_el_main, { class: "layout-main", style: normalizeStyle(isFixedHeader.value ? `height: calc(100% - ${setMainHeight.value})` : `minHeight: calc(100% - ${setMainHeight.value})`) }, { default: withCtx(() => [ createVNode( _component_el_scrollbar, { ref_key: "layoutMainScrollbarRef", ref: layoutMainScrollbarRef, class: "layout-main-scroll layout-backtop-header-fixed", "wrap-class": "layout-main-scroll", "view-class": "layout-main-scroll" }, { default: withCtx(() => [ createVNode(unref(LayoutParentView)), isFooter.value ? (openBlock(), createBlock(unref(LayoutFooter), { key: 0 })) : createCommentVNode("v-if", true) ]), _: 1 /* STABLE */ }, 512 /* NEED_PATCH */ ), createVNode(_component_el_backtop, { target: setBacktopClass.value }, null, 8, ["target"]) ]), _: 1 /* STABLE */ }, 8, ["style"]); }; } }); export { _sfc_main as default };