简体   繁体   English

vscode 的实时预览扩展元素部分似乎无法正常工作

[英]vscode's Live Preview extension element section doesn't seems to working properly

I have a very basic html file that look like this:我有一个非常基本的 html 文件,如下所示:

基本的html文件

then I opened it with Live Preview extension:然后我用 Live Preview 扩展打开它:

实时预览扩展

then I clicked the hamburger menu and opened the 'Devtools Pane':然后我单击汉堡菜单并打开“Devtools 窗格”:

开发工具窗格

The issue is why my elements section looks complicated like this:问题是为什么我的元素部分看起来像这样复杂:

实时预览的元素部分

however, if I open the html file with browser and open developer tools everything is normal:但是,如果我用浏览器打开 html 文件并打开开发者工具,一切正常:

浏览器的开发者工具

I tried uninstall and install Live preview extension but this doesn't solve the problem.我尝试卸载并安装实时预览扩展,但这并不能解决问题。

Is there a solution to this?有针对这个的解决方法吗?

thanks in advance.提前致谢。

The Dev Tools Pane looks like this because that is Visual Studio Codes developer tool pane.开发工具窗格看起来像这样,因为那是 Visual Studio Codes 开发人员工具窗格。 You are seeing all of the elements and scripts that Visual Studio Code uses plus your document.您将看到 Visual Studio Code 使用的所有元素和脚本以及您的文档。 You will get the same results if you open the developer tools in Visual Studio Code via the command palette.如果您通过命令面板在 Visual Studio Code 中打开开发人员工具,您将获得相同的结果。 This isn't something specific to this extension.这不是此扩展程序所特有的。

This answer provides some insight on why this is, but basically it's because Visual Studio Code is built like a desktop application but with web-based (like?) technologies such as HTML and Javascript.这个答案提供了一些关于为什么会这样的见解,但基本上这是因为 Visual Studio Code 是像桌面应用程序一样构建的,但使用了基于 Web 的(比如?)技术,例如 HTML 和 Javascript。

If you are looking for specific elements in your document, I recommend you use the element picker icon in the top left of the dev tools to inspect it, which will automatically navigate the HTML code in the developer pane to the element you wish to inspect.如果您在文档中查找特定元素,我建议您使用开发工具左上角的元素选择器图标来检查它,它会自动将开发人员窗格中的 HTML 代码导航到您要检查的元素。 Or, open the file in a browser separately as you have.或者,您也可以在浏览器中单独打开文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM