qg_java_17137
qg_java_17137

Reputation: 3569

When I use WebStorm open the vue project, there is Import decralations are not supported error

Import decralations are not supported by current JavaScript version

When I use WebStorm open the vue project.

My code is bellow:

import Vue from 'vue'
import App from './App.vue'

new Vue({
  el: '#app',
  render: h => h(App)
})

The snapshot:

enter image description here

Upvotes: 1

Views: 159

Answers (1)

aircraft
aircraft

Reputation: 26896

import xxx from xxx is a new feature in ECMAScript6, you can find in there.

In the WebStorm you should change the JavaScript language version to ECMAScript6.

WebStorm -> Preferences -> Languages & Frameworks -> Javascript:

enter image description here


EDIT

Thanks @lena:

There is a easy way to realize it:

hit Alt+Enter on the error message, choose Change Javascript language version to ECMAScript 6 from the popup

Upvotes: 2

Related Questions