fix: 监听activetop判断layout
Former-commit-id: 3b7237dff95897e71c7598e3b30731ceb6832625
This commit is contained in:
@@ -11,7 +11,6 @@ import { usePermissionStore } from "@/store/modules/permission";
|
|||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
const permissionStore = usePermissionStore();
|
const permissionStore = usePermissionStore();
|
||||||
const { width } = useWindowSize();
|
const { width } = useWindowSize();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 响应式布局容器固定宽度
|
* 响应式布局容器固定宽度
|
||||||
*
|
*
|
||||||
@@ -30,9 +29,11 @@ const activeTopMenu = computed(() => {
|
|||||||
// 混合模式左侧菜单
|
// 混合模式左侧菜单
|
||||||
const mixLeftMenu = ref<any[]>([]);
|
const mixLeftMenu = ref<any[]>([]);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const layout = computed(() => settingsStore.layout);
|
||||||
watch(
|
watch(
|
||||||
() => activeTopMenu.value,
|
() => activeTopMenu.value,
|
||||||
(newVal) => {
|
(newVal) => {
|
||||||
|
if (layout.value !== "mix") return;
|
||||||
permissionStore.routes.forEach((item) => {
|
permissionStore.routes.forEach((item) => {
|
||||||
if (item.path === newVal) {
|
if (item.path === newVal) {
|
||||||
mixLeftMenu.value = item.children || [];
|
mixLeftMenu.value = item.children || [];
|
||||||
@@ -49,7 +50,6 @@ watch(
|
|||||||
immediate: true,
|
immediate: true,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const layout = computed(() => settingsStore.layout);
|
|
||||||
|
|
||||||
const classObj = computed(() => ({
|
const classObj = computed(() => ({
|
||||||
hideSidebar: !appStore.sidebar.opened,
|
hideSidebar: !appStore.sidebar.opened,
|
||||||
|
|||||||
Reference in New Issue
Block a user