perf: layout page

This commit is contained in:
ibuler
2023-02-16 15:56:05 +08:00
parent 9b5e964c68
commit 8fe24a56ef
3 changed files with 12 additions and 17 deletions

View File

@@ -1,5 +1,11 @@
<template>
<TabPage v-if="!loading" :active-menu.sync="iActiveMenu" :submenu="iSubmenu" @tab-click="handleTabClick">
<TabPage
v-if="!loading"
:active-menu.sync="iActiveMenu"
:submenu="iSubmenu"
:title="iTitle"
@tab-click="handleTabClick"
>
<template #headingRightSide>
<span v-if="hasRightSide">
<ActionsGroup slot="headingRightSide" :actions="pageActions" />
@@ -85,7 +91,6 @@ export default {
return title
}
}
},
data() {
const vm = this
@@ -241,9 +246,6 @@ export default {
this.$emit('tab-click', tab, this.iActiveMenu)
this.$emit('update:activeMenu', tab.name)
this.$log.debug('Current tab is: ', this.activeMenu)
},
handleGoBack() {
return this.goBack.bind(this)(this.object)
}
}
}
@@ -264,14 +266,4 @@ export default {
.page-submenu >>> .el-tabs__nav-wrap {
position: static;
}
.go-back {
border: none;
padding: 2px 2px;
}
.go-back >>> i {
font-size: 18px;
font-weight: 600;
}
</style>

View File

@@ -1,8 +1,8 @@
<template>
<div class="page">
<PageHeading v-if="iTitle || helpMessage" class="disabled-when-print">
<slot name="title">
<el-button :disabled="gobackDisabled" class="go-back" icon="el-icon-back" @click="handleGoBack" />
<slot name="title">
<span style="padding-left: 10px">{{ iTitle }}</span>
</slot>
<template #rightSide>
@@ -49,6 +49,9 @@ export default {
return this.title || this.$route.meta.title
},
gobackDisabled() {
if (this.$route.path.endsWith('dashboard')) {
return true
}
return window.history.length <= 2
}
},

View File

@@ -1,5 +1,5 @@
<template>
<Page>
<Page v-bind="$attrs">
<template #headingRightSide>
<slot name="headingRightSide" />
</template>