先安装
1
npm i -S eslint-plugin-vue

.eslintrc下

1
2
3
"plugins": [
    "vue"
]

 vscode首选项 添加

1
2
3
4
5
6
7
8
"eslint.autoFixOnSave"true,
"eslint.validate": [
    "javascript",{
        "language""vue",
        "autoFix"true
    },"html",
    "vue"
],

 当按ctrl+s保存的时候,格式才会发生变化

空格,引号都会变成我们需要的格式

引用https://www.cnblogs.com/anxiaoyu/p/9390280.html

相关文章: