[Fix][UI Next][V1.0.0-Beta] Fix bug where route is error in file manage root (#9697)

dev
Devosend 2022-04-24 15:29:50 +08:00 committed by GitHub
parent 0643fe44a4
commit 48d526f275
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 5 deletions

View File

@ -134,6 +134,12 @@ export default defineComponent({
handleShowModal(renameShowRef)
}
const handleGoRoot = () => {
router.push({
name: 'file-manage'
})
}
const updateList = () => {
resourceListRef.value = getResourceListState(
fileId.value,
@ -226,6 +232,7 @@ export default defineComponent({
handleRenameFile,
handleUpdatePage,
handleUpdatePageSize,
handleGoRoot,
pagination: paginationReactive,
renameInfo,
breadcrumbItemsRef
@ -291,11 +298,19 @@ export default defineComponent({
'header-extra': () => (
<NBreadcrumb separator='>' class={styles['breadcrumb']}>
{this.breadcrumbItemsRef?.map((item: BreadcrumbItem) => {
return (
<NBreadcrumbItem href={item.id.toString()}>
{item.fullName}
</NBreadcrumbItem>
)
if (item.id === 0) {
return (
<NBreadcrumbItem>
<span onClick={this.handleGoRoot}>{item.fullName}</span>
</NBreadcrumbItem>
)
} else {
return (
<NBreadcrumbItem href={item.id.toString()}>
{item.fullName}
</NBreadcrumbItem>
)
}
})}
</NBreadcrumb>
),