gpt4 book ai didi

polymer - 如何处理 Polymer v1 中的 document.registerElement 弃用?

转载 作者:行者123 更新时间:2023-12-02 16:04:51 26 4
gpt4 key购买 nike

在浏览器控制台中,我看到:

[Deprecation] document.registerElement is deprecated and will be removed in M73, around March 2019. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 for more details.

它来自 polymer-micro.html:443,它来 self 项目中的 Polymer 1.11.3 包。我相信这是最新的 v1 版本。

在不将 Polymer 更新到 v2 的情况下如何处理此问题?我尝试更新到 Polymer 2,但在运行时失败。我猜 api 已经改变了。

最佳答案

为了使基于 polymer v1 的组件能够与最新版本的现代浏览器配合使用,您应该在主 html 中以类似于此的方式添加 Web 组件 v0 填充

<script src="/bower_components/webcomponentsjs/webcomponents-lite-min.js"></script>

有关此方面的更多信息,请查看 polymer 团队的 blog post

关于polymer - 如何处理 Polymer v1 中的 document.registerElement 弃用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53592187/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com