perf: 修改 tab 选择

This commit is contained in:
ibuler
2024-05-27 17:30:10 +08:00
parent c8f6d0b595
commit f07e14e62f
3 changed files with 8 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
<template>
<Page class="tab-page" v-bind="$attrs">
<Page v-if="!loading" class="tab-page" v-bind="$attrs">
<template #headingRightSide>
<slot name="headingRightSide" />
</template>
@@ -46,7 +46,7 @@
<el-alert v-if="helpMessage" type="success">
<span class="announcement-main" v-html="helpMessage" />
</el-alert>
<transition v-if="loading" appear mode="out-in" name="fade-transform">
<transition v-if="!loading" appear mode="out-in" name="fade-transform">
<slot>
<keep-alive>
<component :is="computeActiveComponent" />
@@ -122,19 +122,16 @@ export default {
const activeTab = to.query?.tab
if (activeTab && this.iActiveMenu !== activeTab) {
this.iActiveMenu = activeTab
this.loading = false
setTimeout(() => {
this.loading = true
})
}
}
},
activated() {
this.iActiveMenu = this.getPropActiveTab()
this.loading = false
},
mounted() {
console.log('Mounted ')
created() {
this.iActiveMenu = this.getPropActiveTab()
this.loading = false
},
methods: {
handleTabClick(tab) {

View File

@@ -69,6 +69,7 @@ export default {
title: i18n.t('FileExplorer'),
activeMenu: '/assets',
icon: 'file-manager',
external: true,
permissions: ['rbac.view_filemanager']
}
}

View File

@@ -70,7 +70,7 @@ $single-menu-height: 38px;
padding: 19px 20px !important;
line-height: 36px;
min-width: 200px;
font-size: 12px;
font-size: 13px;
letter-spacing: .03em;
&:hover,
@@ -110,7 +110,7 @@ $single-menu-height: 38px;
height: $single-menu-height;
line-height: $single-menu-height;
min-width: 200px;
font-size: 12px;
font-size: 13px;
&:hover,
&.is-active {