vue保存格式化

1.根目录添加 .prettierrc 文件

{
  "eslintIntegration": true,  //让prettier使用eslint的代码格式进行校验
  "semi": false, //去掉代码结尾的分号
  "singleQuote": true  //使用带引号替代双引号
}

或者

在settings.json里添加

"vetur.format.defaultFormatterOptions": {
    "js-beautify-html": {
      "wrap_attributes": "auto"
      // #vue组件中html代码格式化样式
    },
    "prettier": {
      "singleQuote": true, //用单引号
      "semi": false //不加分号
    }
  },

猜你喜欢

转载自blog.csdn.net/weixin_50587417/article/details/128521487