feat: Breadcrumb add Icon
This commit is contained in:
parent
cb5dd34e17
commit
acde2c1004
@ -1,12 +1,15 @@
|
|||||||
<template>
|
<template>
|
||||||
<n-breadcrumb>
|
<n-breadcrumb>
|
||||||
<n-breadcrumb-item v-for="item in route.matched" :key="item.path" @click="handleBreadClick(item.path)">
|
<n-breadcrumb-item v-for="item in route.matched" :key="item.path" @click="handleBreadClick(item.path)">
|
||||||
|
<component :is="renderIcon(item.meta?.icon, { size: 16 })" v-if="item.meta?.icon" />
|
||||||
{{ item.meta.title }}
|
{{ item.meta.title }}
|
||||||
</n-breadcrumb-item>
|
</n-breadcrumb-item>
|
||||||
</n-breadcrumb>
|
</n-breadcrumb>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { renderIcon } from '@/utils/icon'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ export default [
|
|||||||
meta: {
|
meta: {
|
||||||
title: '组件示例',
|
title: '组件示例',
|
||||||
role: ['admin'],
|
role: ['admin'],
|
||||||
|
icon: 'mdi:menu',
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user