前言
如题,在vue3中进行按需加载来动态的渲染icon图标;
在线案例:https://stackblitz.com/edit/9ufmeo?file=src%2Fdemo.vue
内容
<template>
<t-space direction="vertical">
<t-space break-line v-for="(item, index) in iconList" :key="index">
<component :is="iconList[index]" />
</t-space>
</t-space>
</template>
<script setup>
import { Download1Icon, TabIcon } from "tdesign-icons-vue-next";
import { markRaw, reactive } from "vue";
const iconList = reactive([markRaw(Download1Icon), markRaw(TabIcon)]);
</script>
标签:tdesign,vue,渲染,next,markRaw,ICON,加载
From: https://www.cnblogs.com/wangyang0210/p/18156944