@fmdevui/fm-dev
Version:
Page level components developed based on Element Plus.
104 lines (101 loc) • 3.29 kB
JavaScript
import { defineComponent, ref, nextTick, onMounted, watch, resolveComponent, createBlock, openBlock, withCtx, createVNode } from 'vue';
import { useRoute } from 'vue-router';
import { storeToRefs } from 'pinia';
import '../../stores/index.mjs';
import { NextLoading } from '../../ui/loading/index.mjs';
import '../component/aside.vue.mjs';
import '../component/header.vue.mjs';
import '../component/main.vue.mjs';
import { useThemeConfig } from '../../stores/themeConfig.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';
var _sfc_main = /* @__PURE__ */ defineComponent({
__name: "defaults",
setup(__props) {
const layoutScrollbarRef = ref("");
const layoutMainRef = ref("");
const route = useRoute();
const storesThemeConfig = useThemeConfig();
const { themeConfig } = storeToRefs(storesThemeConfig);
const updateScrollbar = () => {
layoutScrollbarRef.value.update();
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();
NextLoading.done(600);
});
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(_sfc_main$1),
createVNode(_component_el_container, { class: "layout-container-view h100" }, {
default: withCtx(() => [
createVNode(
_component_el_scrollbar,
{
ref_key: "layoutScrollbarRef",
ref: layoutScrollbarRef,
class: "layout-backtop"
},
{
default: withCtx(() => [
createVNode(_sfc_main$2),
createVNode(
_sfc_main$3,
{
ref_key: "layoutMainRef",
ref: layoutMainRef
},
null,
512
/* NEED_PATCH */
)
]),
_: 1
/* STABLE */
},
512
/* NEED_PATCH */
)
]),
_: 1
/* STABLE */
})
]),
_: 1
/* STABLE */
});
};
}
});
export { _sfc_main as default };