VS code 設置使用快捷鍵打開瀏覽器運行當前代碼


當前版本信息:

版本 1.20.0
提交 c63189deaa8e620f650cc28792b8f5f3363f2c5b
日期 2018-02-07T17:09:39.780Z
Shell 1.7.9
渲染器 58.0.3029.110
Node 7.9.0
架構 x64

之前一直用的Atom,最近轉入了vs code,真命令式代碼控制啊。。。

  1. ctrl+P ,輸入.vscode
    這里寫圖片描述
    打開tasks.json

2.將代碼修改成如下,路徑改成自己的(注腳本名子當前版本是label,以前的name廢棄了)

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Run HTML file with Chrome",
            "type": "process",  // [shell,process]
            "command": "Chrome",
            "args": ["${file}"],
            "windows": {
                "command": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"
            },
            "group": "build",
            "presentation": {
                // Reveal the output only if unrecognized errors occur.
                "reveal": "never"  //[always,never,silent]
            },
            // Use the standard MS compiler pattern to detect errors, warnings and infos
            "problemMatcher": "$msCompile"
        }
    ]
}

3.在html文件下Ctrl+Shift+B執行,
這里寫圖片描述


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM