Skip to content

Commit

Permalink
fix(projects): fix GlobalBreadcrumb warning
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Apr 13, 2024
1 parent 757d1d6 commit dd6fce3
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/layouts/modules/global-breadcrumb/index.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<script setup lang="ts">
import { useAttrs } from 'vue';
import { createReusableTemplate } from '@vueuse/core';
import type { RouteKey } from '@elegant-router/types';
import { useThemeStore } from '@/store/modules/theme';
import { useRouteStore } from '@/store/modules/route';
import { useRouterPush } from '@/hooks/common/router';
defineOptions({
name: 'GlobalBreadcrumb'
name: 'GlobalBreadcrumb',
inheritAttrs: false
});
const attrs = useAttrs();
const themeStore = useThemeStore();
const routeStore = useRouteStore();
const { routerPushByKey } = useRouterPush();
Expand All @@ -25,16 +28,16 @@ function handleClickMenu(key: RouteKey) {
</script>

<template>
<ABreadcrumb v-if="themeStore.header.breadcrumb.visible">
<!-- define component start: BreadcrumbContent -->
<DefineBreadcrumbContent v-slot="{ breadcrumb }">
<div class="i-flex-y-center align-middle">
<component :is="breadcrumb.icon" v-if="themeStore.header.breadcrumb.showIcon" class="mr-4px text-icon" />
{{ breadcrumb.label }}
</div>
</DefineBreadcrumbContent>
<!-- define component end: BreadcrumbContent -->

<!-- define component start: BreadcrumbContent -->
<DefineBreadcrumbContent v-slot="{ breadcrumb }">
<div class="i-flex-y-center align-middle">
<component :is="breadcrumb.icon" v-if="themeStore.header.breadcrumb.showIcon" class="mr-4px text-icon" />
{{ breadcrumb.label }}
</div>
</DefineBreadcrumbContent>
<!-- define component end: BreadcrumbContent -->

<ABreadcrumb v-if="themeStore.header.breadcrumb.visible" v-bind="attrs">
<ABreadcrumbItem v-for="item in routeStore.breadcrumbs" :key="item.key">
<BreadcrumbContent :breadcrumb="item" />

Expand Down

0 comments on commit dd6fce3

Please sign in to comment.