cdn引入element,使用element自带的icon图标
·
cdn引入element,使用element自带的icon图标,报以下错误

解决办法
原因:使用element的icon图标,除了js和css文件外,还得下载element-icons.ttf和element-icons.woff这两个文件
第一步:引入element的js、css文件
<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
第二步:获取element-icons.ttf和element-icons.woff文件
1)在浏览器的地址栏里输入css文件的地址

2)使用快捷键Ctrl+F搜索.ttf及.woff后缀名,分别找到对应文件路径。并替换‘index.css’即为该文件的地址


element-icons.ttf文件地址:https://unpkg.com/element-ui@2.15.5/lib/theme-chalk/fonts/element-icons.ttf
element-icons.woff文件地址:https://unpkg.com/element-ui@2.15.5/lib/theme-chalk/fonts/element-icons.woff
第三步:创建font文件夹,并将下载好的element-icons.ttf和element-icons.woff文件放在该文件夹下。如图:

更多推荐



所有评论(0)