配置vscode格式化代码不换行

在vscode中点击左上角的文件----->首选项----->设置, 搜索setting, 点击"在setting.json中编辑"
加入以下代码
(每次格式化代码,都换行,看着太那啥…特此记录一下)

 "vetur.format.defaultFormatterOptions": {
    "js-beautify-html": {
      // "wrap_attributes": "force-aligned"
      // vue组件中html代码格式化样式
      "wrap_attributes": "auto"
    },
    "prettyhtml": {
      "printWidth": 100,
      "singleQuote": false,
      "wrapAttributes": false,
      "sortAttributes": false
    }
  },
Logo

前往低代码交流专区

更多推荐