fix(breadcrumb): 修复点击当前面包屑会跳转的缺陷
--bug=1036952 --user=吕梦园 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001036952
This commit is contained in:
parent
51e5f5fe03
commit
d117e72f1f
|
@ -1,6 +1,10 @@
|
|||
<template>
|
||||
<a-breadcrumb v-if="appStore.breadcrumbList.length > 0" class="z-10 mb-[-8px]">
|
||||
<a-breadcrumb-item v-for="crumb of appStore.breadcrumbList" :key="crumb.name" @click="jumpTo(crumb)">
|
||||
<a-breadcrumb-item
|
||||
v-for="(crumb, index) of appStore.breadcrumbList"
|
||||
:key="crumb.name"
|
||||
@click="jumpTo(crumb, index)"
|
||||
>
|
||||
{{ isEdit ? t(crumb.editLocale || crumb.locale) : t(crumb.locale) }}
|
||||
</a-breadcrumb-item>
|
||||
</a-breadcrumb>
|
||||
|
@ -46,7 +50,11 @@
|
|||
}
|
||||
}, true);
|
||||
|
||||
function jumpTo(crumb: BreadcrumbItem) {
|
||||
function jumpTo(crumb: BreadcrumbItem, index: number) {
|
||||
// 点击当前页面的面包屑,不跳转
|
||||
if (index === appStore.breadcrumbList.length - 1) {
|
||||
return;
|
||||
}
|
||||
if (crumb.isBack && window.history.state.back) {
|
||||
router.back();
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue