Vue - 一个配置文件引发的问题

我在虚拟机中访问主机中的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

posted on 2021-04-22 19:57  sunylat  阅读(243)  评论(0编辑  收藏  举报