@fmdevui/fm-dev
Version:
Page level components developed based on Element Plus.
95 lines (92 loc) • 3.14 kB
JavaScript
import { defineComponent, ref, computed, nextTick, onMounted, watch, resolveComponent, createBlock, openBlock, withCtx, createVNode, unref, createElementVNode, createCommentVNode } 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 '../navBars/tagsView/tagsView.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 _sfc_main$4 from '../navBars/tagsView/tagsView.vue2.mjs';
import { useThemeConfig } from '../../stores/themeConfig.mjs';
const _hoisted_1 = { class: "flex-center layout-backtop" };
var _sfc_main = /* @__PURE__ */ defineComponent({
__name: "classic",
setup(__props) {
const LayoutAside = _sfc_main$1;
const LayoutHeader = _sfc_main$2;
const LayoutMain = _sfc_main$3;
const LayoutTagsView = _sfc_main$4;
const layoutMainRef = ref();
const route = useRoute();
const storesThemeConfig = useThemeConfig();
const { themeConfig } = storeToRefs(storesThemeConfig);
const isTagsview = computed(() => {
return themeConfig.value.isTagsview;
});
const updateScrollbar = () => {
layoutMainRef.value?.layoutMainScrollbarRef.update();
};
const initScrollBarHeight = () => {
nextTick(() => {
setTimeout(() => {
updateScrollbar();
if (layoutMainRef.value) 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" }, {
default: withCtx(() => [
createVNode(unref(LayoutHeader)),
createVNode(_component_el_container, { class: "layout-mian-height-50" }, {
default: withCtx(() => [
createVNode(unref(LayoutAside)),
createElementVNode("div", _hoisted_1, [
isTagsview.value ? (openBlock(), createBlock(unref(LayoutTagsView), { key: 0 })) : createCommentVNode("v-if", true),
createVNode(
unref(LayoutMain),
{
ref_key: "layoutMainRef",
ref: layoutMainRef
},
null,
512
/* NEED_PATCH */
)
])
]),
_: 1
/* STABLE */
})
]),
_: 1
/* STABLE */
});
};
}
});
export { _sfc_main as default };