在VsCode
中ctrl+s
后會在當前目錄下自動生成dist
目錄
![](/d/20211017/f418f717ea83789c578021c0bdda110d.gif)
解決辦法:關閉compile-hero
插件
在設置中搜索compile-hero
插件
關閉所有自動生成dist
目錄的選項(如下圖所示)
![](/d/20211017/f274c577f98ad8a2fd56650af723adb3.gif)
PS:下面看下vue項目Ctrl+s vscode代碼自動格式化
前言
多人開發(fā)vue項目,代碼風格形式不一
vscode保存代碼,自動按照eslint規(guī)范格式化代碼設置(vscode最新版配置)
vscode插件
首先vscode需要裝一些vscode插件
ESLint、Vetur、Prettier-Code formatter、GitLens-Git supercharged
配置settings.json
打開settings.json,貼上配置,注意自己原有的vscode主題和字體等不要替換掉
打開方式
方式一:
1)文件 ------.>【首選項】---------->【設置】
2)搜索emmet.include;
3)在settings.json下的【工作區(qū)設置】中添加
方式二:
Ctrl + P 搜索settings.json
貼上如下配置
{
"window.zoomLevel": 0,
"diffEditor.ignoreTrimWhitespace": false,
"workbench.colorTheme": "One Monokai",
"editor.fontSize": 14,
"workbench.editor.enablePreview": true, //預覽模式關閉
"editor.formatOnSave": true, // #每次保存的時候自動格式化
// 自動修復
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
},
"eslint.enable": true, //是否開啟vscode的eslint
// vscode默認啟用了根據(jù)文件類型自動設置tabsize的選項
"editor.detectIndentation": false,
// 重新設定tabsize
"editor.tabSize": 2,
// #去掉代碼結尾的分號
"prettier.semi": false,
// #使用單引號替代雙引號
"prettier.singleQuote": true,
// #讓prettier使用eslint的代碼格式進行校驗
"prettier.eslintIntegration": true,
"javascript.preferences.quoteStyle": "double",
"typescript.preferences.quoteStyle": "double",
// #讓函數(shù)(名)和后面的括號之間加個空格
"javascript.format.insertSpaceBeforeFunctionPare
到此這篇關于VsCode中ctrl+s后會在當前目錄下自動生成dist目錄的方法的文章就介紹到這了,更多相關VsCode當前目錄下自動生成dist目錄內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
您可能感興趣的文章:- vscode寫python時的代碼錯誤提醒和自動格式化的方法
- vscode 配置vue+vetur+eslint+prettier自動格式化功能
- vscode配置vue下的es6規(guī)范自動格式化詳解
- Vue-cli Eslint在vscode里代碼自動格式化的方法