mirror of
https://gitee.com/fantastic-admin/basic.git
synced 2024-12-05 05:27:39 +08:00
移除模板代码中的 $route
This commit is contained in:
parent
5ff0aba078
commit
01b4da8480
@ -8,6 +8,8 @@ defineOptions({
|
|||||||
name: 'SubSidebar',
|
name: 'SubSidebar',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
const settingsStore = useSettingsStore()
|
const settingsStore = useSettingsStore()
|
||||||
const menuStore = useMenuStore()
|
const menuStore = useMenuStore()
|
||||||
|
|
||||||
@ -30,12 +32,12 @@ function onSidebarScroll(e: Event) {
|
|||||||
<template v-for="(mainItem, mainIndex) in menuStore.allMenus" :key="mainIndex">
|
<template v-for="(mainItem, mainIndex) in menuStore.allMenus" :key="mainIndex">
|
||||||
<div v-show="mainIndex === menuStore.actived">
|
<div v-show="mainIndex === menuStore.actived">
|
||||||
<el-menu
|
<el-menu
|
||||||
:unique-opened="settingsStore.settings.menu.subMenuUniqueOpened" :default-openeds="menuStore.defaultOpenedPaths" :default-active="$route.meta.activeMenu || $route.path" :collapse="settingsStore.mode === 'pc' && settingsStore.settings.menu.subMenuCollapse" :collapse-transition="false" :class="{
|
:unique-opened="settingsStore.settings.menu.subMenuUniqueOpened" :default-openeds="menuStore.defaultOpenedPaths" :default-active="route.meta.activeMenu || route.path" :collapse="settingsStore.mode === 'pc' && settingsStore.settings.menu.subMenuCollapse" :collapse-transition="false" :class="{
|
||||||
'is-collapse-without-logo': settingsStore.settings.menu.menuMode !== 'single' && settingsStore.settings.menu.subMenuCollapse,
|
'is-collapse-without-logo': settingsStore.settings.menu.menuMode !== 'single' && settingsStore.settings.menu.subMenuCollapse,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template v-for="(route, index) in mainItem.children">
|
<template v-for="(item, index) in mainItem.children">
|
||||||
<SidebarItem v-if="route.meta?.sidebar !== false" :key="route.path || index" :item="route" :base-path="route.path" />
|
<SidebarItem v-if="item.meta?.sidebar !== false" :key="item.path || index" :item="item" :base-path="item.path" />
|
||||||
</template>
|
</template>
|
||||||
</el-menu>
|
</el-menu>
|
||||||
</div>
|
</div>
|
||||||
|
@ -75,7 +75,7 @@ onUnmounted(() => {
|
|||||||
<SubSidebar />
|
<SubSidebar />
|
||||||
</div>
|
</div>
|
||||||
<div class="sidebar-mask" :class="{ show: settingsStore.mode === 'mobile' && !settingsStore.settings.menu.subMenuCollapse }" @click="settingsStore.toggleSidebarCollapse()" />
|
<div class="sidebar-mask" :class="{ show: settingsStore.mode === 'mobile' && !settingsStore.settings.menu.subMenuCollapse }" @click="settingsStore.toggleSidebarCollapse()" />
|
||||||
<div class="main-container" :style="{ 'padding-bottom': $route.meta.paddingBottom } as any">
|
<div class="main-container" :style="{ 'padding-bottom': routeInfo.meta.paddingBottom } as any">
|
||||||
<Topbar v-if="!(settingsStore.settings.menu.menuMode === 'head' && !settingsStore.settings.menu.enableSubMenuCollapseButton && !settingsStore.settings.breadcrumb.enable)" />
|
<Topbar v-if="!(settingsStore.settings.menu.menuMode === 'head' && !settingsStore.settings.menu.enableSubMenuCollapseButton && !settingsStore.settings.breadcrumb.enable)" />
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<router-view v-slot="{ Component, route }">
|
<router-view v-slot="{ Component, route }">
|
||||||
|
@ -3,9 +3,13 @@ meta:
|
|||||||
enabled: false
|
enabled: false
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
const router = useRouter()
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<page-main>
|
<page-main>
|
||||||
<el-button @click="$router.go(-1)">
|
<el-button @click="router.go(-1)">
|
||||||
返回
|
返回
|
||||||
</el-button>
|
</el-button>
|
||||||
</page-main>
|
</page-main>
|
||||||
|
Loading…
Reference in New Issue
Block a user