问题描述

 ERROR  Failed to compile with 1 error                                                                                                                                                                  16:17:24

[eslint]
C:\Users\xuhuichen\Desktop\gpyh-ec-wx-front\src\components\a1.vue
  1:1  error  Component name "a1" should always be multi-word  vue/multi-word-component-names

✖ 1 problem (1 error, 0 warnings)


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.
ERROR in [eslint]
C:\Users\xuhuichen\Desktop\gpyh-ec-wx-front\src\components\a1.vue
  1:1  error  Component name "a1" should always be multi-word  vue/multi-word-component-names

✖ 1 problem (1 error, 0 warnings)

解决方法

思路

这么多错 全都是因为eslint严格格式
关闭eslint严格格式就好

方法

直接在根目录下创建vue.config.js文件,关键代码lintOnSave: false,

const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  lintOnSave: false,
})
Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐