提示当前路由文件位置

pull/1/head
LiuJiaNan 2024-02-21 09:09:20 +08:00
parent 4976baad59
commit 83dd3a57a9
1 changed files with 27 additions and 5 deletions

View File

@ -3,7 +3,28 @@
style="display: flex; justify-content: space-between; align-items: center"
>
<div class="breadcrumb">
<el-tooltip
v-if="isDEV"
placement="top"
:content="
route.matched
.at(-1)
.components.default.__file.substring(
route.matched
.at(-1)
.components.default.__file.indexOf('src/views')
)
"
>
<icon-local theme="filled" size="22" fill="#10a7e5" :stroke-width="3" />
</el-tooltip>
<icon-local
v-else
theme="filled"
size="22"
fill="#10a7e5"
:stroke-width="3"
/>
<el-breadcrumb class="app-breadcrumb" separator=">">
<transition-group name="breadcrumb">
<el-breadcrumb-item
@ -23,15 +44,15 @@
</div>
<div class="return">
<el-button
type="primary"
text
link
@click="$router.back()"
v-if="
route.meta?.activeMenu &&
route.path &&
route.meta?.activeMenu !== route.path
"
type="primary"
text
link
@click="$router.back()"
>
返回上一页
</el-button>
@ -46,6 +67,7 @@ import { useRoute } from "vue-router";
defineOptions({
name: "LayoutBreadcrumb",
});
const isDEV = import.meta.env.DEV;
const route = useRoute();
const data = reactive({
breadcrumbList: [],