The version of vsCode has been updated in recent days, and the current version number is: 1.43. In fact, every time I update the vsCode version number, I don’t feel any obvious changes, but I just update it casually. And this time vsCode really helped me a lot.
As we all know, when we write html pages, we often bind many attributes or events to elements. If we don’t wrap the line, it will be ugly. So my daily practice is to have a single line for each attribute, just like this:
<nz-pagination [nzPageIndex]=2 [nzTotal]=500 nzShowSizeChanger nzShowQuickJumper></nz-pagination>
But after this update, I will automatically format it as long as I save the html, and move all attributes to one line, just like this:
<label (click)=changeItem('code') [ngClass]={'active': activeItem == 'code'}>Hello World</label>
I tolerated it at first, but as more and more attributes are bound to an element, I really collapsed. I thought it was a trick to install some plugin, but I searched it and it didn't seem that the plugin installed was formatted for html. So I deleted all my 26 plugins before I was irritated!
But the problem has not been solved. So I focused on the plugin with vscode. It turned out that vsCode automatically checked me on this option after the last version was updated. . .
I hope you will check this place first when encountering such problems in the future, so as not to be the same as me. I won’t talk about it anymore, I’ll install the plug-in. . .
SummarizeThis is the article about solving the problem of automatic formatting of html after saving in vscode. For more related vscode html formatting content, please search for previous articles from Wulin.com or continue to browse the related articles below. I hope everyone will support Wulin.com in the future!