fix: patch prototype

This commit is contained in:
kangwei 2020-05-29 01:57:09 +08:00
parent 6d0a8ffde6
commit f20bfaa884
3 changed files with 5 additions and 1 deletions

View File

@ -249,6 +249,9 @@ export class ComponentMeta {
} }
return true; return true;
} }
// compatiable vision
prototype?: any;
} }
export function isComponentMeta(obj: any): obj is ComponentMeta { export function isComponentMeta(obj: any): obj is ComponentMeta {

View File

@ -744,7 +744,7 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
} }
getPrototype() { getPrototype() {
return this; return this.componentMeta.prototype;
} }
getIcon() { getIcon() {

View File

@ -229,6 +229,7 @@ class Prototype {
const metadata = isNewSpec(input) ? input : upgradeMetadata(input); const metadata = isNewSpec(input) ? input : upgradeMetadata(input);
this.meta = designer.createComponentMeta(metadata); this.meta = designer.createComponentMeta(metadata);
} }
(this.meta as any).prototype = this;
} }
getId() { getId() {