时间:  2016-04-27 17:46:48

作者: zhongxia

———————————————————————-

Q: Webpack Module build failed: SyntaxError: ‘import’ and 'export' may appear only with 'sourceType: module'

A:  在 .eslintrc 配置对象里面 加上如下配置

"parserOptions":{"ecmaVersion":6,"sourceType":"module","ecmaFeatures":{"jsx":true,"experimentalObjectRestSpread":true,"modules":true}}


Q: Expected property shorthand  object-shorthand
 
let bar = 1111;
let obj = {bar:bar};   // error  报这个错
 
如何修改:
 
let obj = {bar:111}  // 使用最简单的方式,不要赋值给对象,在赋值到对象里面
const

相关文章:

  • 2021-07-07
  • 2021-09-24
  • 2021-09-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-15
  • 2021-11-02
  • 2022-12-23
  • 2021-06-06
  • 2022-12-23
相关资源
相似解决方案