修复Icon缺失报错的问题
This commit is contained in:
parent
9a1b7b5a52
commit
e20d7d5135
@ -1,12 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-icon v-if="icon.includes('icon')" :class="`iconfont ${icon}`" :size="size" />
|
<el-icon v-if="!icon" :size="size" />
|
||||||
|
<el-icon v-else-if="icon.includes('icon')" :class="`iconfont ${icon}`" :size="size" />
|
||||||
<el-icon v-else :size="size"> <component :is="icon" /></el-icon>
|
<el-icon v-else :size="size"> <component :is="icon" /></el-icon>
|
||||||
</template>
|
</template>
|
||||||
<script setup name="layout-icon">
|
<script setup name="layout-icon">
|
||||||
defineProps({
|
defineProps({
|
||||||
icon: {
|
icon: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
default: '',
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user