-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41c384f
commit d927989
Showing
12 changed files
with
264 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<script setup lang="ts"> | ||
import type { RouteKey } from '@elegant-router/types'; | ||
import { useRouteStore } from '@/store/modules/route'; | ||
import { useRouterPush } from '@/hooks/common/router'; | ||
defineOptions({ | ||
name: 'GlobalBreadcrumb' | ||
}); | ||
const route = useRouteStore(); | ||
const { routerPushByKey } = useRouterPush(); | ||
function handleClickMenu(key: RouteKey) { | ||
routerPushByKey(key); | ||
} | ||
</script> | ||
|
||
<template> | ||
<ABreadcrumb> | ||
<ABreadcrumbItem v-for="item in route.breadcrumbs" :key="item.key"> | ||
<div class="i-flex-y-center align-middle"> | ||
<component :is="item.icon" class="mr-4px text-icon" /> | ||
{{ item.label }} | ||
</div> | ||
<template v-if="item.children?.length" #overlay> | ||
<AMenu> | ||
<AMenuItem v-for="option in item.children" :key="option.key" @click="handleClickMenu(option.routeKey)"> | ||
<div class="flex-y-center gap-12px"> | ||
<component :is="option.icon" /> | ||
<span>{{ option.label }}</span> | ||
</div> | ||
</AMenuItem> | ||
</AMenu> | ||
</template> | ||
</ABreadcrumbItem> | ||
</ABreadcrumb> | ||
</template> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.