Firefox中的Element.shadowRoot [英] Element.shadowRoot in firefox
问题描述
由于Firefox中的Element.shadowRoot尚不可用,我们该如何解决呢?
How can we workaround Element.shadowRoot in Firefox since it is not available yet ?
关于Element.shadowRoot https://developer.mozilla.org/zh-CN/docs/Web/API/Element/shadowRoot
About Element.shadowRoot https://developer.mozilla.org/en-US/docs/Web/API/Element/shadowRoot
推荐答案
您需要加载polyfills.但是shadowDOM Polyfill具有一些局限性.
You need to load the polyfills. But the shadowDOM Polyfill comes with some limitations.
我个人还不使用shadowDOM,除非我知道我只会使用Chrome.
Personally I don't use shadowDOM yet unless I know I am going Chrome only.
我一直在等待所有主流浏览器在当前版本和以前的版本中支持它,然后再一直使用它.大概一年到18个月了.
I am waiting for all of the major browsers to support it in their current version and previous version before I start using it all the time. That is probably a year to 18 months out.
以下是有关polyfills的信息: https://www.webcomponents.org/polyfills
Here is info on the polyfills: https://www.webcomponents.org/polyfills
这篇关于Firefox中的Element.shadowRoot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!