search
HomeWeb Front-endJS TutorialDetailed explanation of the steps to add *.vue files to webstorm

This time I will bring you a detailed explanation of the steps to add *.vue files to webstorm. What are the precautions for adding *.vue files to webstorm? Here are practical cases, let's take a look.

Method 1: Installation Vue.js plug-in

Open Settings->Plugins search and install

css preprocessor support

When I wrote this article, there was no solution to support preprocessing, but now it is very simple.

Add rel="stylesheet/scss" to the style tag Attribute to support scss syntax. You can change it to less stylus based on the rules.

<style>
</style>

Method 2: Webstorm EAP version already natively supports vue files

Look herehttps://blog. jetbrains.com/webstorm/2017/02/webstorm-2017-1-eap-171-2822/ The EAP version may not be stable, but it can still be used.
Or wait for the stable version of Webstorm 2017.1 to be released in a while.

I have to say that vue is getting more and more powerful the more you use it, and Webstorm has also begun to support it. In the end, native support is the best

The following content is out of date, for the old version of Webstorm

webstorm is a front-end development artifact, but I have never liked webstorm because it is very The cool color scheme and the big cursor.

I started playing with Vuejs a while ago. In Vue, you can use .vue files to implement componentization, but various editors don’t support it well. The author also developed related software for sublime. vue plugin. I think using sublime is a waste of life. It takes so much time to install plug-ins and configure the environment. I choose IDE!

I have been using Sublime to write Vue for a month. There are no smart prompts (but for heavy dependence prompts), the code cannot be formatted, and the indentation can be adjusted manually. Damn it, it is not easy to persist for such a long time. So I messed around with webstorm to see how to support it, so I came up with this note.

vue support

Open Settings => File Types Find HTML and add *.vue

This way vue The file is equivalent to an html file, you can edit css and js, and it also has smart prompts.

I usually use es6, so if vue writes es6 code, webstorm will still report an error.

vue supports ES6

Add the type="es6" attribute to the script tag

<script>
</script>

Then open Settings => ; Language Injections Add XML Tag Injection, the content is as shown below.

*.js supports ES6

webstorm default js file is ES5 Syntax

Open Settings => Languages ​​& Frameworks => Javascript

Change Javascript Language version to ECMAScript 6

PS: If you want to write css preprocessing such as sass and stylus in the vue file, webstorm does not support it. I also tried adding Injection. The code highlighting is normal, but it is temporary. As long as the code is changed , a lot of red lines will be drawn again. After google, this seems to be a known bug of webstorm.

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

Detailed explanation of PHP shared memory usage and signal control usage

PHP quick implementation of array deduplication method

The above is the detailed content of Detailed explanation of the steps to add *.vue files to webstorm. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
webstorm怎么运行vue项目webstorm怎么运行vue项目Apr 08, 2024 pm 01:57 PM

要使用 WebStorm 运行 Vue 项目,可以按照以下步骤进行操作:安装 Vue CLI创建 Vue 项目打开 WebStorm启动开发服务器运行项目查看浏览器中的项目在 WebStorm 中调试项目

WebStorm2021如何安装?安装教程详解【附图】WebStorm2021如何安装?安装教程详解【附图】Aug 02, 2022 pm 05:27 PM

对于入门JavaScript 开发的者,最重要的就是安装WebStorm软件,一款非常优秀的JavaScript工具,在互联网上查询目前还没有一篇写得比较详细的WebStorm教程。今天分享WebStorm2021.3.2版本的安装教程,从下载到安装以及创建项目带大家完整的走一遍。

webstorm怎么创建htmlwebstorm怎么创建htmlApr 08, 2024 pm 01:42 PM

使用 WebStorm 创建 HTML 项目分五步:创建新项目并配置 HTML 设置;添加新 HTML 文件;编写 HTML 代码并利用实时预览;预览 HTML 文件并进行部署;使用模板和 Emmet 快捷方式加快开发。

webstorm怎么改中文版webstorm怎么改中文版Apr 08, 2024 pm 12:24 PM

将 WebStorm 更改为中文版:打开 WebStorm 设置。导航到“Appearance & Behavior”>“Language & Fonts”。在“User Interface Language”中选择“Chinese (Simplified)”或“Chinese (Traditional)”。重启 WebStorm,界面将显示为中文。

webstorm怎么切换中文webstorm怎么切换中文Apr 08, 2024 pm 01:30 PM

WebStorm 中切换中文方法:打开设置面板(Windows/Linux:Ctrl + Alt + S;macOS:Command + ,)。导航至“外观和行为”>“语言和框架”。在“用户界面语言”下拉菜单中选择“IntelliJ IDEA 用户界面”。在“Locale”列表中选择所需的中文语言(例如“中文(中国大陆)”)。点击“应用”,重启 WebStorm。

webstorm怎么恢复默认webstorm怎么恢复默认Apr 08, 2024 pm 12:15 PM

要恢复 WebStorm 为默认设置,请关闭 WebStorm 并删除首选项目录,然后重新启动 WebStorm。详细步骤包括:完全退出 WebStorm。删除首选项目录(具体位置因操作系统而异)。重新启动 WebStorm。

webstorm怎么新建项目webstorm怎么新建项目Apr 08, 2024 am 11:57 AM

使用 WebStorm 创建新项目的步骤:打开 WebStorm并选择“新建项目”;根据需要选择项目类型,如 Node.js、React 等;配置项目设置,包括名称、位置和框架版本;对于特定项目类型,选择所需框架;单击“创建”按钮生成项目;项目将自动在 WebStorm 中打开,供您编写代码和构建应用程序。

webstorm怎么创建vue项目webstorm怎么创建vue项目Apr 08, 2024 pm 12:03 PM

通过以下步骤在 WebStorm 中创建 Vue 项目:安装 WebStorm 和 Vue CLI。在 WebStorm 中创建一个 Vue 项目模板。使用 Vue CLI 命令创建项目。将现有项目导入 WebStorm。使用 "npm run serve" 命令运行 Vue 项目。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft