|
@@ -3,9 +3,9 @@
|
|
|
<el-breadcrumb separator="/" class="app-breadcrumb">
|
|
<el-breadcrumb separator="/" class="app-breadcrumb">
|
|
|
<el-breadcrumb-item :to="{ path: '/' }">{{ $t('common.home') }}</el-breadcrumb-item>
|
|
<el-breadcrumb-item :to="{ path: '/' }">{{ $t('common.home') }}</el-breadcrumb-item>
|
|
|
<el-breadcrumb-item
|
|
<el-breadcrumb-item
|
|
|
- v-for="item in breadcrumbItems"
|
|
|
|
|
|
|
+ v-for="(item, index) in breadcrumbItems"
|
|
|
:key="item.path"
|
|
:key="item.path"
|
|
|
- :to="item.path === $route.path ? undefined : {path: item.path}"
|
|
|
|
|
|
|
+ :to="isLastItem(index) ? undefined : {path: item.path}"
|
|
|
>
|
|
>
|
|
|
{{ item.name }}
|
|
{{ item.name }}
|
|
|
</el-breadcrumb-item>
|
|
</el-breadcrumb-item>
|
|
@@ -65,6 +65,10 @@ const breadcrumbItems = computed(() => {
|
|
|
|
|
|
|
|
return items
|
|
return items
|
|
|
});
|
|
});
|
|
|
|
|
+// 辅助函数:判断是否为最后一个面包屑项
|
|
|
|
|
+const isLastItem = (index) => {
|
|
|
|
|
+ return index === breadcrumbItems.value.length - 1
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|