Vue错误日志

1. Trailing spaces not allowed

删除多余空行即可

2. Newline required at end of file but not found

文件末尾需要换行符,但找不到
解决:=> 在 js css等后面再加一行(空行)

3. error Extra semicolon semi

不使用分号

4. 多次引入 element-ui
2:24  error  'E:\Develop\Apache\htdocs\econ.com\node_modules\element-ui\lib\element-ui.common.js' imported multiple times  import/no-duplicates
3:32  error  'E:\Develop\Apache\htdocs\econ.com\node_modules\element-ui\lib\element-ui.common.js' imported multiple times  import/no-duplicates
4:23  error  'E:\Develop\Apache\htdocs\econ.com\node_modules\element-ui\lib\element-ui.common.js' imported multiple times  import/no-duplicates
6:1   error  More than 1 blank line not allowed                                                                            no-multiple-empty-lines

使用一次 import 即可

// ========== before ===========
import { Button } from 'element-ui'
import { Form, FormItem } from 'element-ui'
import { Input } from 'element-ui'
// ========== before ===========
import { Button, Form, FormItem, Input } from 'element-ui'
5. tab四字节导致的错误

31:1 error Expected indentation of 4 spaces but found 0 indent
33:1 error Expected indentation of 6 spaces but found 4 indent
34:1 error Expected indentation of 8 spaces but found 4 indent
35:1 error Expected indentation of 8 spaces but found 4 indent
36:1 error Expected indentation of 6 spaces but found 4 indent
37:1 error Expected indentation of 4 spaces but found 0 indent
38:1 error Expected indentation of 2 spaces but found 0 indent

修改编辑器tab 键字节数,修改设置settings.json

"editor.tabSize": 4
- 指定一个tab等于多少个空格,例如此处指定4就像等于4个空格,2就等于两个空格
"editor.detectIndentation":false 
- 必须指定!!否则指定的tab大小将不起效果
6. 没必要的返回语句

Unnecessary return statement no-useless-return

login() {
  // console.log(this)登陆时候的预校验。
  this.$refs.loginFormRef.validate(valid => {
    if (!valid) return
  })
}
// ========= 修改 ============
login() {
  // console.log(this)登陆时候的预校验。
  this.$refs.loginFormRef.validate(valid => {
    if (!valid) return false 
  })
}
7. vue ui 启动可视化面板一片空白
删除 C:\Users\Administrator 下的 '.vue-cli-ui' 文件即可
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值