在 PhpStorm/Webstorm 中导入不使用 JavaScript
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36295525/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Import not working with JavaScript in PhpStorm/Webstorm
提问by user3089840
I'm trying to run a piece of JavaScript code written in a tutorial that looks like this:
我正在尝试运行一段在教程中编写的 JavaScript 代码,如下所示:
main.js
主文件
import Vue from 'Vue';
import Alert from './components/Alert.vue';
new Vue({
el: 'body',
components: { Alert }
})
However, PhpStorm is giving the following error:
但是,PhpStorm 给出了以下错误:
Import declarations are not supported by current JavaScript version
当前 JavaScript 版本不支持导入声明
How I can get a newer(?) JavaScript version in PhpStorm? Is that really the problem here?
如何在 PhpStorm 中获得更新的(?)JavaScript 版本?这真的是这里的问题吗?