logo

该视频仅会员有权观看

立即开通课程「Web前端页面基础」权限。

¥
199
/ 年

用 Live Server 实时预览网页变化(VSCode)

- Live Server is a VS Code editor extension for quickly creating a web server with real-time preview features.
- To install it, open VS Code's command palette, search for "install extensions", and then for "live server".
- After installation, open a webpage document from your project, right-click, and select "open with live server" to start the server.
- This allows you to edit the document's content, stylesheet, or script files directly in the editor, and see changes in real-time in the browser without manually refreshing the page.
- Live Server automatically refreshes the browser when it detects changes in the project files.
- It works because Live Server injects a script into the web page, which you can observe near the body tag in the browser's developer tools. This script updates the page display when the document changes.