我已经成功构建了许多 Polymer 2.0 元素,它们在支持 ES6 的浏览器中运行良好。
当我尝试将它们转换为 ES5 时,浏览器会抛出一堆错误,如下所示:
Failed to construct 'HTMLElement': Please use the 'new' operator, this DOM object constructor cannot be called as a function.
经过一些研究,您似乎需要一个与 webcomponentsjs-es5-loader 一起提供的 native-shim,但在切换到该组件后,现在我遇到了一个新错误:
Class constructor DomModule cannot be invoked without 'new'
转译的 Polymer 2.0 元素如何在 ES5 浏览器中使用?我错过了什么吗?