This commit is contained in:
zhuoda
2022-11-05 22:40:22 +08:00
parent 1f75c9614e
commit f9cc5accde
1807 changed files with 127943 additions and 78167 deletions
@@ -0,0 +1,35 @@
<!--
* 面包屑
*
* @Author: 1024创新实验室-主任卓大
* @Date: 2022-09-06 20:29:12
* @Wechat: zhuda1024
* @Email: lab1024@163.com
* @Copyright 1024创新实验室 https://1024lab.net ),Since 2012
-->
<template>
<a-breadcrumb separator=">" style="display: inline" v-if="breadCrumbFlag">
<a-breadcrumb-item v-for="(item, index) in parentMenuList" :key="index">{{ item.title }}</a-breadcrumb-item>
<a-breadcrumb-item>{{ currentRoute.meta.title }}</a-breadcrumb-item>
</a-breadcrumb>
</template>
<script setup>
import { useRoute } from 'vue-router';
import { useUserStore } from '/@/store/modules/system/user';
import { computed } from 'vue';
import { useAppConfigStore } from '/@/store/modules/system/app-config';
// 是否显示面包屑
const breadCrumbFlag = computed(() => useAppConfigStore().$state.breadCrumbFlag);
let currentRoute = useRoute();
//根据路由监听面包屑
const parentMenuList = computed(() => {
let currentName = currentRoute.name;
if (!currentName || typeof currentName !== 'string') {
return [];
}
let menuParentIdListMap = useUserStore().getMenuParentIdListMap;
return menuParentIdListMap.get(currentName) || [];
});
</script>