【element-ui】HTML引入本地文件出现font找不到/fonts/element-icons.woff
文章目录
- 目录结构
- 问题复现
- 解决办法
目录结构
|-web|- public|- lib|- ...|- index.html
index.html
<!DOCTYPE html><html><head> <meta charset=\"UTF-8\"> <link rel=\"stylesheet\" href=\"./public/lib/index.css\"></head><body><div id=\"app\"> <el-button @click=\"visible = true\">Button</el-button> <el-dialog :visible.sync=\"visible\" title=\"Hello world\"> <p>Try Element</p> </el-dialog></div></body><script src=\"./public/lib/vue.js\"></script><script src=\"./public/lib/index.js\"></script><script> new Vue({ el: \'#app\', data: function() { return { visible: false } } })</script></html>
问题复现
解决办法
放到你的路径下
https://github.com/ElementUI/theme-chalk/tree/master/src/fonts
vue路径不一致需要修改路径