如何使用Visual Studio代码在浏览器中查看我的HTML代码?(How to view my HTML code in browser with Visual Studio Code?)
如何在浏览器中使用新的Microsoft Visual Studio代码查看我的HTML代码?
使用记事本++,您可以选择在浏览器中运行。 如何使用Visual Studio代码做同样的事情?
How to view my HTML code in a browser with the new Microsoft Visual Studio Code?
With otepad++ you have the option to Run in a browser. How can I do the same thing with Visual Studio Code?
最满意答案
对于Windows - 打开您的默认浏览器 - 测试VS代码v 1.1.0
打开一个特定的文件(名称是硬编码)或打开任何其他文件的答案。
脚步:
使用ctrl + shift + p打开命令调板。
键入配置任务运行程序 。 选择它将打开tasks.json文件。 删除显示的脚本,并将其替换为以下内容:
{ "version": "0.1.0", "command": "explorer", "windows": { "command": "" }, "args": ["test.html"] }请记住将tasks.json文件的“args”部分更改为文件的名称。 当您点击F5时,这将始终打开该特定文件。
您也可以使用["${file}"]作为“args”的值,将此值设置为打开您打开的任何文件。 请注意, $在{...} ,所以["{$file}"]不正确。
保存文件。
切换回您的html文件(在本例中为“text.html”),然后按ctrl + shift + b在Web浏览器中查看您的页面。
For Windows - Open your Default Browser - Tested on VS Code v 1.1.0
Answer to both opening a specific file (name is hard-coded) OR opening AY other file.
Steps:
Use ctrl + shift + p (or F1) to open the Command Palette.
Type in Tasks: Configure Task or on older versi Configure Task Runner. Selecting it will open the tasks.json file. Delete the script displayed and replace it by the following:
{ "version": "0.1.0", "command": "explorer", "windows": { "command": "" }, "args": ["test.html"] }Remember to change the "args" section of the tasks.json file to the name of your file. This will always open that specific file when you hit F5.
You may also set the this to open whichever file you have open at the time by using ["${file}"] as the value for "args". ote that the $ goes outside the {...}, so ["{$file}"] is incorrect.
Save the file.
Switch back to your html file (in this example it's "text.html"), and press ctrl + shift + b to view your page in your Web Browser.
#感谢您对电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格的认可,转载请说明来源于"电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格
推荐阅读
留言与评论(共有 7 条评论) |
本站网友 买房风水学 | 21分钟前 发表 |
"command" | |
本站网友 学生瘦腿的最快方法 | 0秒前 发表 |
切换回您的html文件(在本例中为“text.html”) | |
本站网友 防风通圣丸 | 1分钟前 发表 |
"windows" | |
本站网友 左益 | 4分钟前 发表 |
并将其替换为以下内容: { "version" | |
本站网友 栾川二手房 | 17分钟前 发表 |
选择它将打开tasks.json文件 | |
本站网友 肌苷片 | 16分钟前 发表 |
{ "version" |