cdn引入element,使用element自带的icon图标

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

在这里插入图片描述

解决办法

原因:使用element的icon图标,除了js和css文件外,还得下载element-icons.ttfelement-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.ttfelement-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.ttfelement-icons.woff文件放在该文件夹下。如图:
在这里插入图片描述

  • 13
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值