扩展原生 HTML 元素和 Polymer 2.0

Extending native HTML elements and Polymer 2.0

有没有办法扩展原生元素(例如 HTMLInputElementHTMLTableElement 等)而不是 Polymer.Element

您的问题的简短回答是目前还没有。背后的原因是所有的浏览器都没有同意实现它,这就是为什么 polymer 还没有实现它。

Polymer does not currently support extending built-in elements. The custom elements spec provides a mechanism for extending built-in elements, such as and . The spec calls these elements customized built-in elements. Customized built-in elements provide many advantages (for example, being able to take advantage of built-in accessibility features of UI elements like and ). However, not all browser makers have agreed to support customized built-in elements, so Polymer does not support them at this time.