首页
注册
登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请
登录
V2EX
›
Vite
element plus 按钮的问题,求帮助
qq309187341
·
141 天前
· 375 次点击
这是一个创建于 141 天前的主题,其中的信息可能已经有所发展或是发生改变。
请问各位大佬。vite2 中使用 unplugin-icons/resolver 这个插件自动导入图标。正常使用没有问题,但是放在 button 中使用就显示不出来了。
1:无法显示
<el-button text size="large" :icon="props.collapsed ? IExpand : IFold" class="collapsed">
</el-button>
2.可以显示
<el-button text size="large" class="collapsed">
<IExpand />
</el-button>
请问是写法不对,还是哪些需要配置。倾向第一种方式。如果是因为使用了插件导致组件库无法识别的话,目前无法解决的话,我只能使用第二种方式了。
el-button
collapsed
iexpand
Text
3 条回复
•
2022-11-11 15:33:19 +08:00
1
zcf0508
141 天前
自动导入必须是直接声明的,不能动态使用
2
zcf0508
141 天前
可以改用两个组件,然后加 v-if 判断
3
qq309187341
OP
141 天前
@
zcf0508
也就是只能使用第二种方式了?如果想使用第一种方式,只能是 improt 导入进来是的吧?
关于
·
帮助文档
·
博客
·
nftychat
·
API
·
FAQ
·
我们的愿景
·
广告投放
·
实用小工具
·
957 人在线
最高记录 5556
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 34ms ·
UTC 20:59
·
PVG 04:59
·
LAX 13:59
·
JFK 16:59
Developed with
CodeLauncher
♥ Do have faith in what you're doing.