最佳答案
从本质上讲,它封装了代码,使其更易于管理.如果不使您生成的代码功能无法使用,那么您不一定要删除它.
以下是您正在使用的库隐藏的代码,因此您不必担心编码某些对象. Chrome允许您查看代码中#shadow Doms的位置.
#shadow-root (user-agent)
从以下链接查看此说明:
“In a nutshell Shadow DOM is a new part of the HTML spec which allows
developers to encapsulate their HTML markup,CSS styles and
JavaScript. Shadow DOM,along with a few other technologies which
we’ll cover later,gives developers the ability to build their own 1st
class tags and APIs just like the or tag.
Collectively,these new tags and APIs are referred to as Web
Components.”
以下链接是帮助理解影子DOM的关键:
http://robdodson.me/blog/2013/08/26/shadow-dom-introduction/
这样可以使用shadow DOM来创建自定义标记:
https://www.polymer-project.org/
原文链接:https://www.f2er.com/html/426085.html