fix: 修复horizontal模式下menu在生产环境显示问题

This commit is contained in:
xiaoxian521 2022-10-18 19:16:17 +08:00
parent e50d13a84a
commit 5bce4dfa6a
2 changed files with 10 additions and 2 deletions

View File

@ -1,7 +1,7 @@
<script setup lang="ts">
import { ref, watch } from "vue";
import Search from "../search/index.vue";
import Notice from "../notice/index.vue";
import { ref, watch, nextTick } from "vue";
import SidebarItem from "./sidebarItem.vue";
import avatars from "/@/assets/avatars.jpg";
import { useNav } from "/@/layout/hooks/useNav";
@ -26,6 +26,10 @@ const {
getDropdownItemClass
} = useNav();
nextTick(() => {
menuRef.value?.handleResize();
});
watch(
() => route.path,
() => {

View File

@ -4,7 +4,7 @@ import Notice from "../notice/index.vue";
import avatars from "/@/assets/avatars.jpg";
import { useNav } from "/@/layout/hooks/useNav";
import { transformI18n } from "/@/plugins/i18n";
import { ref, toRaw, watch, onMounted } from "vue";
import { ref, toRaw, watch, onMounted, nextTick } from "vue";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
import { getParentPaths, findRouteByPath } from "/@/router/utils";
import { useTranslationLang } from "../../hooks/useTranslationLang";
@ -43,6 +43,10 @@ onMounted(() => {
getDefaultActive(route.path);
});
nextTick(() => {
menuRef.value?.handleResize();
});
watch(
() => route.path,
() => {