vs中加载html时不对,vs code中添加Vue格式化时不支持格式化html部分的支持

1.首先安装vetur

2.然后配置vscode的设置项,如下

{

"explorer.confirmDragAndDrop": true, // 当拖动一个文件或者文件夹到另一个文件夹时,是否启动提示

"editor.fontSize": 14, // 设置编辑器字体大小

"editor.tabSize": 2, // 设置编辑器一个tab占多少个空格

"editor.renderWhitespace": "all", // 空格是否显示

"editor.lineHeight": 20, // 编辑器行高

"javascript.implicitProjectConfig.experimentalDecorators": true, // 使用vscode编辑器出现,experimentaldecorators报错

"window.zoomLevel": 0, // Adjust the zoom level of the window

"editor.detectIndentation": false, // When opening a file, `editor.tabSize` and `editor.insertSpaces` will be detected based on the file contents.

"typescript.updateImportsOnFileMove.enabled": "always", // Enable/disable automatic updating of import paths when you rename or move a file in VS Code. Possible values are: 'prompt' on each rename, 'always' update paths automatically, and 'never' rename paths and don't prompt me. Requires TypeScript >= 2.9

"files.autoSave": "onFocusChange",

"vetur.format.defaultFormatter": {

"html": "prettier",

"css": "prettier",

"postcss": "prettier",

"scss": "prettier",

"less": "prettier",

"js": "prettier",

"ts": "prettier",

"stylus": "stylus-supremacy"

}

}

提示不存在配置别管,照配

如果要配置格式化选项,那么需要新增一个文件

.prettierrc

具体格式规则在下面配置就行了,如下

{

"semi": false,

"overrides": [

{

"files": "*.test.js",

"options": {

"semi": true

}

}

]

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值