Skip to content

Commit f445ca1

Browse files
author
allen
committed
feat: 代码优化
1 parent 6b9c95b commit f445ca1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/components/base/TreeMenu.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ defineProps<{
88
<template v-for="menu in menus" :key="menu.path">
99
<el-sub-menu v-if="menu.children && menu.children.length > 0" :index="menu.path">
1010
<template #title>
11-
<div class="mr-10 box-border min-w-24" :class="menu.meta.icon" />
11+
<div class="mr-10 min-w-24" :class="menu.meta.icon" />
1212
<span>{{ menu.meta.title }}</span>
1313
</template>
1414
<TreeMenu :menus="menu.children" />
1515
</el-sub-menu>
1616
<el-menu-item v-else :index="menu.path">
17-
<div class="mr-10 box-border min-w-24" :class="menu.meta.icon" />
17+
<div class="mr-10 min-w-24" :class="menu.meta.icon" />
1818
<template #title>
1919
{{ menu.meta.title }}
2020
</template>

src/components/layout/Header.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const breadcrumbArr = computed(() => {
2525
2626
// 更新头部tabs
2727
onBeforeRouteUpdate((to, _from, next) => {
28-
const tab = { title: to.meta.title, name: to.name }
28+
const tab = { title: to.meta.title, name: to.name } as App.Tab
2929
addTab(tab)
3030
next()
3131
})

src/pages/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const { tabs } = useStore('app')
1414
<el-main>
1515
<router-view v-slot="{ Component, route }">
1616
<transition name="fade-transform" mode="out-in">
17-
<keep-alive :include="tabs.map((i: any) => i.name)">
17+
<keep-alive :include="tabs.map((i) => i.name)">
1818
<component :is="Component" :key="route.name" />
1919
</keep-alive>
2020
</transition>

0 commit comments

Comments
 (0)