交易所前端蓝色ui 4.5 jiem
jhzh
2025-05-19 c5487881d04780e03f4dd86ed1606c587f2c7952
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<template>
  <!-- 1.路由 -->
  <h5 class="fs-12 mt-4 mb-8">{{ t("home") }}/ {{ t(getRouteName) }}</h5>
</template>
<script setup>
import { useRoute, useRouter } from "vue-router";
import { useI18n } from "vue-i18n";
const router = useRouter();
const route = useRoute();
const { t } = useI18n();
const routeList = computed(() => router.options.routes);
const forexRoutes = routeList.value.filter((it) => it.path === "/");
const getRouteName = computed(() => {
  const rp = route.path;
  const item = forexRoutes[0].children.find((it) => it.path === rp); //获取匹配路径的路由
  return item?.label || "";
});
</script>
 
<style lang="scss" scoped>
.fs-12 {
  font-size: 12px;
}
</style>