导入elementui运行报错

本文介绍了如何在项目中遇到Eslint警告时,通过修改config/index.js中的useEslint设置,将检测机制关闭。重点讲解了出现的'Extrasemicolon'、'No multiple empty lines'等问题及解决方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 ✘  http://eslint.org/docs/rules/semi                     Extra semicolon
  src\main.js:4:35
  import ElementUI from 'element-ui';
                                     ^

  ✘  http://eslint.org/docs/rules/semi                     Extra semicolon
  src\main.js:5:46
  import 'element-ui/lib/theme-chalk/index.css';
                                                ^

  ✘  http://eslint.org/docs/rules/no-multiple-empty-lines  More than 1 blank line not allowed
  src\main.js:8:1

   ^

  ✘  http://eslint.org/docs/rules/semi                     Extra semicolon
  src\main.js:11:19
  Vue.use(ElementUI);

 

查看报错日志,发现是警告引起的。

解决办法:取消Eslint的检测机制,将userEslint的值改为false即可,在config目录下的index.js找到useEslint: true,改为 useEslint: false

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值