@fmdevui/fm-dev
Version:
Page level components developed based on Element Plus.
79 lines (74 loc) • 2.41 kB
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var vueRouter = require('vue-router');
var pinia = require('pinia');
require('../../stores/index.js');
require('../component/header.vue.js');
require('../component/main.vue.js');
var header_vue_vue_type_script_setup_true_name_layoutHeader_lang = require('../component/header.vue2.js');
var main_vue_vue_type_script_setup_true_name_layoutMain_lang = require('../component/main.vue2.js');
var themeConfig = require('../../stores/themeConfig.js');
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
__name: "transverse",
setup(__props) {
const LayoutHeader = header_vue_vue_type_script_setup_true_name_layoutHeader_lang.default;
const LayoutMain = main_vue_vue_type_script_setup_true_name_layoutMain_lang.default;
const layoutMainRef = vue.ref();
const storesThemeConfig = themeConfig.useThemeConfig();
const { themeConfig: themeConfig$1 } = pinia.storeToRefs(storesThemeConfig);
const route = vueRouter.useRoute();
const updateScrollbar = () => {
layoutMainRef.value.layoutMainScrollbarRef.update();
};
const initScrollBarHeight = () => {
vue.nextTick(() => {
setTimeout(() => {
updateScrollbar();
layoutMainRef.value.layoutMainScrollbarRef.wrapRef.scrollTop = 0;
}, 500);
});
};
vue.onMounted(() => {
initScrollBarHeight();
});
vue.watch(
() => route.path,
() => {
initScrollBarHeight();
}
);
vue.watch(
() => themeConfig$1.value.isTagsview,
() => {
vue.nextTick(() => {
updateScrollbar();
});
},
{
deep: true
}
);
return (_ctx, _cache) => {
const _component_el_container = vue.resolveComponent("el-container");
return vue.openBlock(), vue.createBlock(_component_el_container, { class: "layout-container flex-center layout-backtop" }, {
default: vue.withCtx(() => [
vue.createVNode(vue.unref(LayoutHeader)),
vue.createVNode(
vue.unref(LayoutMain),
{
ref_key: "layoutMainRef",
ref: layoutMainRef
},
null,
512
/* NEED_PATCH */
)
]),
_: 1
/* STABLE */
});
};
}
});
exports.default = _sfc_main;