![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Vue错误解决收集
使用中各种常见错误
weixin_51799004
这个作者很懒,什么都没留下…
展开
-
eslint报错:Missing space before function parentheses space-before-function-paren
方法名和括号之间需要留一个空格,但格式化之后空格不存在会报错误(Missing space before function parentheses space-before-function-paren)原创 2023-05-30 11:32:31 · 760 阅读 · 1 评论 -
Vue保存时使用Vetur自动格式化代码错误
在VScode中的setting.js文件中的vetur.format.defaultFormatterOptions中添加规则。一、在prettier中添加配置项semi、singleQuote、trailingComma。单引号变成双引号,末尾添加了分号,最后一个属性添加了逗号,缩进2个空格变为4个空格。保存时自动格式化代码之后不符合eslint规范。二、设置vetur中tab size为2。原创 2023-05-30 10:01:57 · 888 阅读 · 1 评论 -
Vue中自定义组件不符合命名规范解决办法Component name “Home“ should always be multi-word.(vue/multi-word-component-nam
不符合Vue中的自定义组件命名规则(有使用大驼峰和横线拼接单词),一、根据编辑器提示,在组件命名之前添加注释声明,可快速解决报错问题。在.eslintrc.js文件中的rules中添加。原创 2023-05-30 09:22:28 · 1128 阅读 · 1 评论