我在虚拟机中访问主机中的Vue网站,发现不能正常访问,打开浏览器调试模式,看到以下错误:

Uncaught SyntaxError: Block-scoped declarations (let, const, functionUncaught SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode, class) not yet supported outside strict mode

错误原因:引入的配置文件需要严格模式。

解决方法:在导致错误的文件中加入:

"use strict";

参考:

https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Strict_mode

相关文章:

  • 2021-12-23
  • 2022-01-04
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
猜你喜欢
  • 2021-06-09
  • 2021-09-22
  • 2021-05-21
  • 2022-01-25
  • 2021-09-18
  • 2021-05-15
  • 2021-06-19
相关资源
相似解决方案