UNPKG

@fmdevui/fm-dev

Version:

Page level components developed based on Element Plus.

108 lines (105 loc) 3.52 kB
import { defineComponent, ref, nextTick, onMounted, watch, resolveComponent, createBlock, openBlock, withCtx, createVNode, unref } from 'vue'; import { useRoute } from 'vue-router'; import { storeToRefs } from 'pinia'; import '../../stores/index.mjs'; import '../component/aside.vue.mjs'; import '../component/header.vue.mjs'; import '../component/main.vue.mjs'; import cclaside from '../component/columnsAside.vue.mjs'; import _sfc_main$1 from '../component/aside.vue2.mjs'; import _sfc_main$2 from '../component/header.vue2.mjs'; import _sfc_main$3 from '../component/main.vue2.mjs'; import { useThemeConfig } from '../../stores/themeConfig.mjs'; var _sfc_main = /* @__PURE__ */ defineComponent({ __name: "columns", setup(__props) { const LayoutAside = _sfc_main$1; const LayoutHeader = _sfc_main$2; const LayoutMain = _sfc_main$3; const ColumnsAside = cclaside; const layoutScrollbarRef = ref(""); const layoutMainRef = ref(); const route = useRoute(); const storesThemeConfig = useThemeConfig(); const { themeConfig } = storeToRefs(storesThemeConfig); const updateScrollbar = () => { layoutScrollbarRef.value.update(); layoutMainRef.value && layoutMainRef.value.layoutMainScrollbarRef.update(); }; const initScrollBarHeight = () => { nextTick(() => { setTimeout(() => { updateScrollbar(); layoutScrollbarRef.value.wrapRef.scrollTop = 0; if (layoutMainRef.value != void 0) layoutMainRef.value.layoutMainScrollbarRef.wrapRef.scrollTop = 0; }, 500); }); }; onMounted(() => { initScrollBarHeight(); }); watch( () => route.path, () => { initScrollBarHeight(); } ); watch( () => [themeConfig.value.isTagsview, themeConfig.value.isFixedHeader], () => { nextTick(() => { updateScrollbar(); }); }, { deep: true } ); return (_ctx, _cache) => { const _component_el_scrollbar = resolveComponent("el-scrollbar"); const _component_el_container = resolveComponent("el-container"); return openBlock(), createBlock(_component_el_container, { class: "layout-container" }, { default: withCtx(() => [ createVNode(unref(ColumnsAside)), createVNode(_component_el_container, { class: "layout-columns-warp layout-container-view h100" }, { default: withCtx(() => [ createVNode(unref(LayoutAside)), createVNode( _component_el_scrollbar, { ref_key: "layoutScrollbarRef", ref: layoutScrollbarRef, class: "layout-backtop" }, { default: withCtx(() => [ createVNode(unref(LayoutHeader)), createVNode( unref(LayoutMain), { ref_key: "layoutMainRef", ref: layoutMainRef }, null, 512 /* NEED_PATCH */ ) ]), _: 1 /* STABLE */ }, 512 /* NEED_PATCH */ ) ]), _: 1 /* STABLE */ }) ]), _: 1 /* STABLE */ }); }; } }); export { _sfc_main as default };