【问题发生】
- vue项目编译之后出现了这样的问题:
✖ 1 problem (1 error, 0 warnings)
1 error and 0 warnings potentially fixable with the --fix
option.
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.
【问题原因】
- 建立项目时,选择了eslint检测,故会有严格的格式检测,但实际上没有必要
【问题解决】
- 在vue.config.js中最后一段,加上
devServer: {
overlay: {
warnings: false,
errors: false
},
lintOnSave: false
}
- 即可取消eslint语法检测,从而解决问题。