feat: Breadcrumb add Icon

This commit is contained in:
张传龙 2022-06-30 18:29:26 +08:00
parent cb5dd34e17
commit acde2c1004
2 changed files with 4 additions and 0 deletions

View File

@ -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()

View File

@ -9,6 +9,7 @@ export default [
meta: { meta: {
title: '组件示例', title: '组件示例',
role: ['admin'], role: ['admin'],
icon: 'mdi:menu',
}, },
children: [ children: [
{ {