| 一、調(diào)試準(zhǔn)備Windows10 64bits IDE:Visual Studio Code1.28.2 安裝插件:Chrome(安裝方法:Debug -> Install Additional Debuggers... -> Debugger for Chrome,重新啟動(dòng)vscode即可。) 二、調(diào)試配置首先該插件運(yùn)行需要安裝有本地服務(wù)器,其次有兩種配置方式,分別為: (1)launch:重新打開一個(gè)chrome來顯示應(yīng)用程序 (2)attach:在已經(jīng)運(yùn)行的chrome中顯示應(yīng)用程序 2.1、Launch配置按F5并選擇chrome進(jìn)入配置文件launch.json,我的Launch配置如下所示: "version": "0.2.0",
"configurations": [
    {
        "type": "chrome",
        "request": "launch",
        "name": "Launch Chrome against localhost",
        "url": "http://localhost/文件路徑",
        "webRoot": "${workspaceFolder}"
    }
]2.2、Attach配置attach的launch.json配置如下所示: {
    "type": "chrome",
    "request": "attach",
    "name": "Attach to Chrome",
    "port": 9222,
    "sourceMaps": true,
    "webRoot": "${workspaceFolder}"
}字由https://www./sites/73248.html 中國(guó)字體設(shè)計(jì)網(wǎng)https://www./sites/73245.html 步驟一:讓chrome進(jìn)入調(diào)試模式: 方法一:在命令行中進(jìn)行設(shè)置: 方法二:chrome桌面圖標(biāo)右鍵 -> 屬性 -> 目標(biāo) -> 在路徑后面添加 --remote-debugging-port=9222 即可。 其中 --remote-debugging-port 的值與lanuch.json中的 port 的值要匹配。然后在瀏覽器中打開本地服務(wù)器上的web頁(yè)面 步驟二:在vscode中打開調(diào)試按鈕進(jìn)行調(diào)試,即可進(jìn)入調(diào)試模式。 
 | 
|  |