element-plus / element-plus-icons

Main package for storing Element Plus icon resources.
MIT License
138 stars 100 forks source link

能否根据字符串变量动态导入 #59

Closed lcnsf18 closed 1 year ago

lcnsf18 commented 1 year ago

const icon = 'Menu' await import('@element-plus/icons-vue/' + icon) 类似这种用法,unplugin-icons好像只能按照字符串字面量导入

snowdream commented 1 year ago

有解决方法吗?

lcnsf18 commented 1 year ago

有解决方法吗?

最后用的@iconify/vue这个包的组件

snowdream commented 1 year ago

有解决方法吗?

最后用的@iconify/vue这个包的组件

好的,谢谢。

目前这种方式很难动态引入图标。