mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-08 02:10:24 +08:00
24 lines
560 B
Vue
24 lines
560 B
Vue
|
|
<script lang="ts">
|
|||
|
|
// 渲染函数:https://v3.cn.vuejs.org/guide/render-function.html
|
|||
|
|
import { h, resolveComponent, defineComponent } from 'vue';
|
|||
|
|
export default defineComponent({
|
|||
|
|
name: 'svgIcon',
|
|||
|
|
props: {
|
|||
|
|
// svg 图标组件名字
|
|||
|
|
name: {
|
|||
|
|
type: String,
|
|||
|
|
},
|
|||
|
|
// svg 大小
|
|||
|
|
size: {
|
|||
|
|
type: Number,
|
|||
|
|
},
|
|||
|
|
// svg 颜色
|
|||
|
|
color: {
|
|||
|
|
type: String,
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
setup(props: any) {
|
|||
|
|
return () => h('i', { class: 'el-icon', style: `--font-size: ${props.size};--color: ${props.color}` }, [h(resolveComponent(`${props.name}`))]);
|
|||
|
|
},
|
|||
|
|
});
|
|||
|
|
</script>
|