24 lines
395 B
Vue
24 lines
395 B
Vue
<template>
|
|
<template v-if="iconType === 'ElIcon'">
|
|
<el-icon>
|
|
<component :is="name"></component>
|
|
</el-icon>
|
|
</template>
|
|
</template>
|
|
<script setup>
|
|
import { ref } from 'vue';
|
|
|
|
const { name } = defineProps({
|
|
name: String
|
|
});
|
|
const iconType = ref('');
|
|
switch (true) {
|
|
case name.startsWith('ElIcon'):
|
|
iconType.value = 'ElIcon';
|
|
break;
|
|
|
|
default:
|
|
break;
|
|
}
|
|
</script>
|