简体   繁体   English

保存后 Visual Studio Code 正在更改 HTML (React)

[英]Visual Studio Code is changing HTML after saving (React)

I started to learn react.我开始学习反应。 A few minutes later messed up.几分钟后就搞砸了。 I was looking for a setting and somehow I come where else where i selected a different choice(something like NodeJS)...now my problem is:我正在寻找一个设置,不知何故我来到了我选择不同选择的其他地方(比如NodeJS)......现在我的问题是:

First Image第一张图片

在此处输入图像描述

Second Image第二张图片

在此处输入图像描述

First image is what I wrote.第一张图是我写的。 Second image is what it became after saving(CTRL + S).第二张图片是保存后的样子(CTRL + S)。

Third Image第三张图片在此处输入图像描述 This third image is the changed original template...这第三张图片是更改后的原始模板...

I tried to reinstall VS Code and deleting the settings(user/json) file nothing has changed.我尝试重新安装 VS Code 并删除设置(用户/json)文件,但没有任何改变。 Does anyone know how to fix this problem.有谁知道如何解决这个问题。

Any help is appreciated :P任何帮助表示赞赏:P

我也遇到了这个错误尝试将js文件重命名为jsx

their is different formatter for react.它们是用于反应的不同格式化程序。 but for instant fix just disable auto formating on save from vscode setting.但对于即时修复,只需从 vscode 设置中禁用保存时自动格式化。

在此处输入图像描述

On the status bar of VS Code, you would see the language that has been set automatically to your file where to find the language mode在 VS Code 的状态栏上,您会看到已自动设置到您的文件的语言,在哪里可以找到语言模式

click on the name of the language and it would take you to this section language mode单击语言的名称,它将带您进入此部分的语言模式

Type the language you want to use for that first and select it or You can select configure file association for '...' and type the language you want to use.(This changes the language forever unless you decide to change it)首先输入您要使用的语言并选择它,或者您可以选择为“...”配置文件关联并输入您要使用的语言。(除非您决定更改它,否则这将永远更改语言)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 保存反应文件时 Visual Studio 代码错误? - Visual Studio code error while saving react files? 保存反应文件特殊 app.js 时 Visual Studio 代码错误? - Visual Studio code error while saving react files special app.js? 在 Visual Studio Code 中反应智能感知 - React intellisense in Visual Studio Code HTML CSS和Visual Studio Professional-2015(请勿与Visual Studio代码混淆) - HTML CSS and Visual Studio Professional - 2015 (Not to be confused with Visual Studio Code) 在 Visual Studio 代码中的字符串中自动完成 html 标记? - autocomplete html tags in strings in Visual Studio code? Visual Studio Code - 保存时文件末尾的新空行 - Visual Studio Code - New blank line at the end of file when saving 在 Visual Studio Code 中保存时避免自动缩进 - Avoid auto indent when saving in Visual Studio Code HTML文件中的智能Javascript建议在Visual Studio代码更新后没有工作 - Smart Javascript suggestions inside HTML files no loger working after Visual Studio Code update React 代码在更改状态后不断重新渲染 - React code keeps rerendering after changing state 如何在 Visual Studio 代码上混合/添加 Javascript 代码到 Html 代码? - How to mix/add Javascript code to Html code on Visual studio code?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM