Home > Web Front-end > JS Tutorial > How to deal with es6 syntax errors in webstorm and .vue

How to deal with es6 syntax errors in webstorm and .vue

php中世界最好的语言
Release: 2018-05-31 09:51:27
Original
1792 people have browsed it

This time I will show you how to deal with es6 syntax errors in webstorm and .vue. What are the precautions for dealing with es6 syntax errors in webstorm and .vue? The following is a practical case. Let’s take a look. .

1. es6 syntax error in webstorm, solution:

Open Settings =>

Languages ​​& Frameworks => Javascript

Change the Javascript Language version to ECMAScript 6

In this way, es6 will no longer report errors in all .js files, but es6 syntax in .vue files Still getting error.

2. es6 syntax error in .vue file

(1) Open Settings =>

File Types found Add *.vue

to HTML so that the vue file is equivalent to an html file. You can edit css and js, and there are also smart prompts. However, the es6 syntax still reports an error in the .vue file.

(2) Rough: Add type="text/ecmascript-6" directly to the
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template