Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.5k views
in Technique[技术] by (71.8m points)

antdesign 中 使用 iconfont symbol方式引入图标不展示

最近在写项目遇到了一个问题,我使用vue框架搭建了一个项目。
我创建了一个 index.js文件,内容为:

import { Icon } from 'ant-design-vue';

const IconFont = Icon.createFromIconfontCN({
scriptUrl: '//at.alicdn.com/t/font_2296540_wpxzi5ar76.js',
});
export default IconFont;

然后在main.js中引入了该组件,
image.png
但是当我在页面中使用这个标签的时候,却发现无论如何小图标都出不来,
image.png
image.png
标红的位置是我放图标的位置,

image.png
找了各种资料都不知道问题处在了哪里,有明白的大神可以和我交流一下吗?非常感谢


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

我引了你的js,只有如下几个svg
image.png
你能使用的图标便只有这个,type值为它们的id,不需要添加icon-


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...