Firefox中的Element.shadowRoot [英] Element.shadowRoot in firefox

查看:247
本文介绍了Firefox中的Element.shadowRoot的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于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屋!

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