To install them, you can run: npm install --save fonts/element-icons.ttf fonts/element-icons.woff

在使用element-ui按需导入时,出现以下错误:

These dependencies were not found:

* fonts/element-icons.ttf in ./node_modules/[email protected]@css-loader??ref--6-oneOf-3-1!./node_modules/[email protected]@postcss-loader/src??ref--
6-oneOf-3-2!./node_modules/[email protected]@element-ui/lib/theme-chalk/index.css
* fonts/element-icons.woff in ./node_modules/[email protected]@css-loader??ref--6-oneOf-3-1!./node_modules/[email protected]@postcss-loader/src??ref-
-6-oneOf-3-2!./node_modules/[email protected]@element-ui/lib/theme-chalk/index.css

To install them, you can run: npm install --save fonts/element-icons.ttf fonts/element-icons.woff

解决错误

出现错误的主要原因是在 vue.config.js 配置文件中设置了 css.modules = true,这个默认的值为 false ,只要把这个设置去掉问题即可得到解决

猜你喜欢

转载自www.cnblogs.com/Super-scarlett/p/12515752.html