【发布时间】:2017-04-08 20:38:36
【问题描述】:
class A extends HTMLElement {
constructor() {
super()
return new Proxy(this, {})
}
}
window.customElements.define('a-element', A)
<a-element></a-element>
如何代理自定义元素?
当我尝试时:
Uncaught InvalidStateError: custom element constructors must call super() first and must not return a different object.
【问题讨论】:
标签: javascript web-component custom-element es6-class es6-proxy