web:fix init and build api
This commit is contained in:
parent
050dfc46ae
commit
bd5391a0ac
9
doric-web/dist/index.js
vendored
9
doric-web/dist/index.js
vendored
@ -5402,8 +5402,11 @@ ${content}
|
|||||||
}
|
}
|
||||||
return Reflect.apply(sandbox.jsCallEntityMethod, this.panel, argumentsList);
|
return Reflect.apply(sandbox.jsCallEntityMethod, this.panel, argumentsList);
|
||||||
}
|
}
|
||||||
init(frame, extra) {
|
init(extra) {
|
||||||
this.invokeEntityMethod("__init__", frame, extra ? JSON.stringify(extra) : undefined);
|
this.invokeEntityMethod("__init__", extra ? JSON.stringify(extra) : undefined);
|
||||||
|
}
|
||||||
|
build(frame) {
|
||||||
|
this.invokeEntityMethod("__build__", frame);
|
||||||
}
|
}
|
||||||
teardown() {
|
teardown() {
|
||||||
for (let plugin of this.pluginInstances.values()) {
|
for (let plugin of this.pluginInstances.values()) {
|
||||||
@ -5453,7 +5456,7 @@ ${content}
|
|||||||
divElement.style.height = '100%';
|
divElement.style.height = '100%';
|
||||||
this.append(divElement);
|
this.append(divElement);
|
||||||
this.context.rootNode.view = divElement;
|
this.context.rootNode.view = divElement;
|
||||||
this.context.init({
|
this.context.build({
|
||||||
width: divElement.offsetWidth,
|
width: divElement.offsetWidth,
|
||||||
height: divElement.offsetHeight,
|
height: divElement.offsetHeight,
|
||||||
});
|
});
|
||||||
|
2
doric-web/dist/index.js.map
vendored
2
doric-web/dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
@ -39,13 +39,15 @@ export class DoricContext {
|
|||||||
return Reflect.apply(jsCallEntityMethod, this.panel, argumentsList)
|
return Reflect.apply(jsCallEntityMethod, this.panel, argumentsList)
|
||||||
}
|
}
|
||||||
|
|
||||||
init(frame: {
|
init(extra?: object) {
|
||||||
|
this.invokeEntityMethod("__init__", extra ? JSON.stringify(extra) : undefined)
|
||||||
|
}
|
||||||
|
build(frame: {
|
||||||
width: number,
|
width: number,
|
||||||
height: number,
|
height: number,
|
||||||
}, extra?: object) {
|
}) {
|
||||||
this.invokeEntityMethod("__init__", frame, extra ? JSON.stringify(extra) : undefined)
|
this.invokeEntityMethod("__build__", frame)
|
||||||
}
|
}
|
||||||
|
|
||||||
teardown() {
|
teardown() {
|
||||||
for (let plugin of this.pluginInstances.values()) {
|
for (let plugin of this.pluginInstances.values()) {
|
||||||
plugin.onTearDown()
|
plugin.onTearDown()
|
||||||
|
@ -51,7 +51,7 @@ export class DoricElement extends HTMLElement {
|
|||||||
divElement.style.height = '100%'
|
divElement.style.height = '100%'
|
||||||
this.append(divElement)
|
this.append(divElement)
|
||||||
this.context.rootNode.view = divElement
|
this.context.rootNode.view = divElement
|
||||||
this.context.init({
|
this.context.build({
|
||||||
width: divElement.offsetWidth,
|
width: divElement.offsetWidth,
|
||||||
height: divElement.offsetHeight,
|
height: divElement.offsetHeight,
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user