UNPKG

@fmdevui/fm-dev

Version:

Page level components developed based on Element Plus.

75 lines (72 loc) 2.15 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/header.vue.mjs'; import '../component/main.vue.mjs'; import _sfc_main$1 from '../component/header.vue2.mjs'; import _sfc_main$2 from '../component/main.vue2.mjs'; import { useThemeConfig } from '../../stores/themeConfig.mjs'; var _sfc_main = /* @__PURE__ */ defineComponent({ __name: "transverse", setup(__props) { const LayoutHeader = _sfc_main$1; const LayoutMain = _sfc_main$2; const layoutMainRef = ref(); const storesThemeConfig = useThemeConfig(); const { themeConfig } = storeToRefs(storesThemeConfig); const route = useRoute(); const updateScrollbar = () => { layoutMainRef.value.layoutMainScrollbarRef.update(); }; const initScrollBarHeight = () => { nextTick(() => { setTimeout(() => { updateScrollbar(); layoutMainRef.value.layoutMainScrollbarRef.wrapRef.scrollTop = 0; }, 500); }); }; onMounted(() => { initScrollBarHeight(); }); watch( () => route.path, () => { initScrollBarHeight(); } ); watch( () => themeConfig.value.isTagsview, () => { nextTick(() => { updateScrollbar(); }); }, { deep: true } ); return (_ctx, _cache) => { const _component_el_container = resolveComponent("el-container"); return openBlock(), createBlock(_component_el_container, { class: "layout-container flex-center layout-backtop" }, { default: withCtx(() => [ createVNode(unref(LayoutHeader)), createVNode( unref(LayoutMain), { ref_key: "layoutMainRef", ref: layoutMainRef }, null, 512 /* NEED_PATCH */ ) ]), _: 1 /* STABLE */ }); }; } }); export { _sfc_main as default };