如果我尝试在Polymerscript中编写具有属性的Polymer3 Mixin, 它将失败,并显示以下错误:
xxx错误地扩展了yyy
属性类型不兼容
我做的像this(但在Typescript中) 有没有办法解决ts-ignore吗?
示例代码:
function VisuElement<B extends Constructor<any>>(base: B) {
return class extends base {
constructor(...args: any[]) {
super();
this._ve = true;
this._veBindings = [];
}
static get properties() {
return {
unbindOnUnload: Boolean //Needed when a Element is created via a Dom repeat
}
}
}
}
用法:
class VisuSignalValueDisplay extends VisuElement(PolymerElement) {
static get template() {
return html`
<div></div>
`;
}
static get is() { return 'visu-signal-value-display'; }
static get properties() {
return {
signalName: String
};
}
}