Webstorm. Vue error (ES6 syntax error)-turn

Source: Internet
Author: User
Tags script tag

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.