1、將項目文件夾添加到工作區
2、點擊“終端”,選擇“配置任務”
3、選擇“使用模板創建tasks.json文件”
4、選擇“Others”
5、tasks.json新建,默認如下
6、修改tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "label": "在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" } ] }
7、選中需要運行的html文件,按住Ctrl+Shift+B,選擇“在Chome中運行”