1.webstorm ES6 syntax error, Solution:
Open Settings = Languages & frameworks = Javascript
Change Javascript Language version to ECMAScript 6
In doing so all the. js files Es6 no longer have an error, but the ES6 syntax in the. vue file continues to error.
2. ES6 syntax error in. vue file
(1) Open Settings = File Types Find HTML Add *.vue
This way the Vue file is equivalent to an HTML file, you can edit the Css,js, and there are smart hints. However, the ES6 syntax is still an error in the. vue file.
(2). Rough: Add Type= "text/ecmascript-6" directly to the <script> tag, and the code inside the. Vue will highlight and support ES6.
(3). Add the script tag type= "ES6" property
<type="ES6" >
</script>
Then open Settings = Language injections Add XML Tag injection, content such as.
3. Add new feature: When you right-click New, the. vue file type appears, just like the new HTML file, the method:
Setting-editor-file and Code Templates Click the plus sign in the upper-right corner to add the Vue file name Vue, Extension to Vue, the following location can fill in the custom initialization template content.
Click OK to return, new in the project will appear vue file webstorm configuration new Vue file complete.
Webstorm. Vue error (ES6 syntax error)-turn