education-demo的错误总结

感悟??

  1. 仅针对自己所发生的问题
  2. eslintrc规范性会把人搞死
  3. App.vue引入的标签要区分大小写,否则会不显示,又不报错

11.24

Q1: Expected linebreaks to be ‘LF’ but found ‘CRLF’

问题原因:eslint的规范检查所导致换行问题
解决方案:在.eslintrc.js文件里增加

rules: {
   "linebreak-style": [0 ,"error", "windows"],//允许windows开发环境
 },

Q2: Missing semicolon

问题原因:eslint规范检查的代码规范问题
解决方案:

//修改前
<script>
   export default{}
</script>

// 修改后
<script>
   export default{};
</script>

Q3: Newline required at end of file but not found.

问题原因:eslint的规范检查的代码规范问题
解决方案:在该页面最后一行加一个回车,及最后一行没有任何字符即可

Q4:Already included file name 和 Missing file extension “vue” for

问题描述:在App.vue里引入外部的的vue文件时,加上 .vue 后缀会报 Already included file name ,去掉 .vue 后缀又会报 Missing file extension “vue” for
问题原因:eslint的规范检查的代码规范问题
解决方案:在.eslintrc.js文件里增加

rules: {
   'import/extensions': ['error', 'always', {
   		'js': 'never',
   		'vue': 'never'
   }]
},
settings: {
   'import/resolver': {
   		webpack: {
   			config: 'node_modules/@vue/cli-service/webpack.config.js',
   		},
   },
},

Q5: The “****” component has been registered but not used

问题原因:eslint规范检查所导致的问题
解决方案:在.eslintrc.js文件里增加

rules: {
   "vue/no-unused-components": "off",
 },

Q6: this line has a lines of 103.maximum allowed is100.(max-len)

问题原因:eslint规范检查对一行的最大字符数所做的规范
解决方案:在.eslintrc.js文件里增加

rules: {
   'max-len' : ["error", {code : 300}],
 },

11.25

Q1: Unknown custom element router-view did you register the component correctly ? For recursive components, make sure to provide the “name” option. (未解决)

可能原因:我自定义的标签与html原生的标签产生了冲突

Q2:The template root requires exactly one element. (未解决)

11.29

Q1:Identifier is not a camel case (camelcase)

问题原因:eslint规范检查
解决方案:在.eslintrc.js文件里增加

rules: {
  "camelcase": [1, {"properties": "never"}],
 },

11.30

Q1:Invalid Host header

未解决

未解决的问题

Q1:Unexpected use of file extension “vue” for “./App.vue” import/extensions

虽然报错,但没有影响运行

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值