fix: 控制 tab 是否可以刷新 (#257)

This commit is contained in:
qlin 2024-11-14 16:16:50 +08:00 committed by GitHub
parent 0280fb9826
commit 4b3fb7b3d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -253,7 +253,7 @@ export const layout = {
- **类型**`boolean` - **类型**`boolean`
- **默认值**`false` - **默认值**`false`
- **详情**:是否开启多页。 - **详情**:是否开启多页。可通过 tabReload: false 控制标签页是否重新加载。
### menus ### menus

View File

@ -12,7 +12,7 @@
<FTabPane v-for="page in pageList" :key="page.path" :value="page.path" :closable="pageList.length > 1"> <FTabPane v-for="page in pageList" :key="page.path" :value="page.path" :closable="pageList.length > 1">
<template #tab> <template #tab>
{{ page.title }} {{ page.title }}
<ReloadOutlined v-show="route.path === page.path" class="layout-tabs-close-icon" @click="reloadPage(page.path)" /> <ReloadOutlined v-if="page.tabReload" v-show="route.path === page.path" class="layout-tabs-close-icon" @click="reloadPage(page.path)" />
</template> </template>
</FTabPane> </FTabPane>
<template #suffix> <template #suffix>
@ -73,6 +73,7 @@ export default {
name: _route.meta.name ?? _route.name, name: _route.meta.name ?? _route.name,
title: computedTitle, title: computedTitle,
key: getKey(), key: getKey(),
tabReload: _route.meta.tabReload ?? true,
}; };
}; };