VS Live Share 和 Live Server [英] VS Live Share and Live Server

查看:35
本文介绍了VS Live Share 和 Live Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在 Visual Studio Code 中使用 VS Live Share,加入的人无法使用 Live Server 扩展打开共享的 HTML 文件.它说:无法获取 .../index.html.Live Server 仅适用于本地文件"吗?也没有选项可以打开文件系统中的共享 HTML 文件并以这种方式打开它.尽快提供帮助.

We are using VS Live Share inside Visual Studio Code and the person who joined cannot open a shared HTML file with the Live Server extension. It says: Cannot GET .../index.html. Does Live Server only work with "local files"? There is also no option to open the shared HTML file in the file system and to open it that way. Help would be nice as quick as possible.

推荐答案

1-按下边栏中的实时共享扩展图标.

1-press the live share extension icon in the sidebar.

2-inside 会话详细信息悬停在共享服务器子类别上.

2-inside session details hover over shared servers sub-category.

3-会显示一个带有绿色加号的电插头,按下它会弹出一个输入字段.

3-an electrical plug with a green plus sign will show, press on it and an input field will pop up.

4-在输入字段中输入您的本地主机端口,例如:localhost:5500 并按 Enter.

4-inside the input field write your localhost port like this e.g: localhost:5500 and press enter.

如果你有一台正在运行的服务器,你可以在 vs code 的右下角找到你的端口号.它看起来像这样:端口:5500.

you can find the number of your port from the bottom right of vs code if you have a live server running. it will look like this: Port:5500.

执行此操作后,您合作伙伴的 vs 代码中将自动显示一条通知,以打开共享实时服务器.

once you do this a notification will automatically show in your partner's vs code to open the shared live server.

这篇关于VS Live Share 和 Live Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆