当前位置: 首页 > news >正文

vscode-vue项目格式化

一、插件要求

Prettier

Vetur

二、配置文件

{"workbench.startupEditor": "newUntitledFile","files.autoSave": "off", // 关闭文件自动保存,避免开发时候页面变化"editor.tabSize": 2, // tab距离"vetur.format.options.tabSize": 2, //"editor.formatOnSave": true, // 在保存时自动格式化"editor.minimap.enabled": true, // 关闭右侧快速预览"files.eol": "\n", // 设定文件的换行符,\n(linux模式)或\r\n(win模式)"editor.detectIndentation": false, // 关闭vscode的缩进检查"editor.fontSize": 14, //设置文字大小"editor.lineHeight": 0, //设置文字行高"editor.lineNumbers": "on", //开启行数提示"editor.quickSuggestions": {//开启自动显示建议"other": true,"comments": true,"strings": true},"window.zoomLevel": 0, // 调整窗口的缩放级别//根据文件后缀名定义vue文件类型"files.associations": {"*.vue": "vue"},// 为各类文件制定Fatmatter插件"[vue]": {// "editor.defaultFormatter": "esbenp.prettier-vscode" // 采用prettier处理格式化"editor.defaultFormatter": "octref.vetur" // 采用vetur来处理Fatmatter},"[javascript]": {"editor.defaultFormatter": "esbenp.prettier-vscode"},"[json]": {"editor.defaultFormatter": "esbenp.prettier-vscode"},"[jsonc]": {"editor.defaultFormatter": "vscode.json-language-features"},// Vetur 的各类设定,仅当上面[vue]的editor.defaultFormatter的值为octref.vetur的时候,才起效"vetur.format.options.tabSize": 4,"vetur.format.defaultFormatter.html": "js-beautify-html", // 针对vue中的template部分的风格模版,也可以是:prettier"vetur.format.defaultFormatter.css": "prettier", // 针对vue中的style部分的风格模版"vetur.format.defaultFormatterOptions": {"js-beautify-html": {  // 给js-beautify-html设置属性隔断"wrap_line_length": 200, //换行长度// 属性换行// 对属性进行换行。// - auto: 仅在超出行长度时才对属性进行换行。// - force: 对除第一个属性外的其他每个属性进行换行。// - force-aligned: 对除第一个属性外的其他每个属性进行换行,并保持对齐。// - force-expand-multiline: 对每个属性进行换行。// - aligned-multiple: 当超出折行长度时,将属性进行垂直对齐。"wrap_attributes": "aligned-multiple",// Maximum number of line breaks to be preserved in one chunk (0 disables)// "max_preserve_newlines": 0,"end_with_newline": false,"singleQuote": true,},"prettyhtml": {"printWidth": 120,"singleQuote": true,"wrapAttributes": false,"sortAttributes": false},"prettier": {// Prettier option here"wrap_attributes": "auto","printWidth": 120,"trailingComma": "none", // 多行时,尽可能打印尾随的逗号"tabWidth": 4, // 会忽略vetur的tabSize配置"useTabs": false, // 是否利用tab替代空格"semi": true, // 句尾是否加;"singleQuote": true, // 使用单引号而不是双引号"arrowParens": "avoid", // allow paren-less arrow functions 箭头函数的参数使用圆括号"trailingComma": "all","htmlWhitespaceSensitivity": "ignore"}},// 函数名后增加空格"javascript.format.insertSpaceBeforeFunctionParenthesis": true,"javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
}

http://www.lryc.cn/news/135482.html

相关文章:

  • SAP MM学习笔记26- SAP中 振替转记(转移过账)和 在库转送(库存转储)1- 移动Type间振替转记
  • SAP SPL(Special Ledger)之注释行项目-Noted Items
  • 学习平台助力职场发展与提升
  • 有没有免费格式转换工具推荐?PDF转化为PPT的方法
  • 【LeetCode-经典面试150题-day12】
  • TCP机制-延迟应答,捎带应答
  • 【Redis从头学-8】Redis中的ZSet数据类型实战场景之用户积分榜
  • Springboot内嵌SQLite配置使用
  • 【微服务学习笔记】认识微服务
  • 基于Android R快速编译recovery-ramdisk.img
  • Redis分布式缓存
  • 最大公约数和最小公倍数
  • 数据结构——二叉搜索树(附带C++实现版本)
  • C++(3)C++对C的扩展Extension
  • 在vscode(idea)使用GitHub账号、Copilot异常
  • 新的后端渲染:服务器驱动UI
  • Postman如何做接口自动化测试?
  • excel文本函数篇2
  • 【MyBatis】动态SQL > 重点:${...}和#{...}与resultMap和resultType的区别
  • 什么是BEM命名规范?为什么要使用BEM命名规范?
  • JavaScript:交集和差集的应用场景
  • 达梦数据库表空间创建和管理
  • 三、MySQL 数据库安装集
  • 【BASH】回顾与知识点梳理(三十九)
  • 蓝蓝设计-UI设计公司案例-HMI列车监控系统界面设计解决方案
  • Blazor前后端框架Known-V1.2.13
  • vue 复制文本
  • 西瓜书第三章
  • 关于python如何使用sqlalchemy连接sap_hana数据库
  • 微信小程序教学系列(5)