VSCode中vue文件的html格式化时,属性标签自动换行的修改


解决方案

1.前提:"vetur.format.defaultFormatter.html": "js-beautify-html",
2.修改"wrap_attributes"为 "aligned-multiple"

    "vetur.format.defaultFormatter.html": "js-beautify-html", //格式化.vue中html
    "js-beautify-html": {
      "wrap_attributes": "aligned-multiple"
      // "wrap_attributes": "force-expand-multiline" //属性强制换行对齐
      // "wrap_attributes": "force-aligned" //属性强制折行对齐
    },

插件及说明

  • Vetur ,vue-beautify
vetur.format.defaultFormatterOptions 对属性进行换行。
  • auto: 仅在超出行长度时才对属性进行换行。
  • force: 对除第一个属性外的其他每个属性进行换行。
  • force-aligned: 对除第一个属性外的其他每个属性进行换行,并保持对齐。
  • force-expand-multiline: 对每个属性进行换行。
  • aligned-multiple: 当超出折行长度时,将属性进行垂直对齐。

作者:借你趁早
链接:https://juejin.cn/post/6884850654544658446
来源:掘金


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM