render-core 1.0.17 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/render/updateRender.js +6 -11
- package/index.js +1 -0
- package/package.json +1 -1
|
@@ -5,34 +5,29 @@ import { cmdForUpdate } from "../../library/cmd/cmd";
|
|
|
5
5
|
export function updateRender(controller) {
|
|
6
6
|
//生成DOM
|
|
7
7
|
var tagTemplate = getTemplate(controller.proto);
|
|
8
|
-
|
|
8
|
+
//清除保存的发布对象
|
|
9
|
+
controller.to = [];
|
|
9
10
|
//beforeRender
|
|
10
|
-
var beforeRender = controller.proto.getBeforeRender().bind(
|
|
11
|
+
var beforeRender = controller.proto.getBeforeRender().bind(controller.raw_data);
|
|
11
12
|
beforeRender();
|
|
12
|
-
//beforeUpdate
|
|
13
|
-
var beforeUpdate = controller.proto.getBeforeUpdate().bind(controllerawData);
|
|
14
|
-
beforeUpdate();
|
|
15
13
|
//解析指令
|
|
16
14
|
cmdForUpdate(tagTemplate, controller.proto, controller);
|
|
17
|
-
//afterUpdate
|
|
18
|
-
var afterUpdate = controller.proto.getAfterUpdate().bind(controllerawData);
|
|
19
|
-
afterUpdate();
|
|
20
15
|
//beforeUnmount
|
|
21
|
-
var beforeUnmount = controller.proto.getBeforeUnmount().bind(
|
|
16
|
+
var beforeUnmount = controller.proto.getBeforeUnmount().bind(controller.raw_data);
|
|
22
17
|
beforeUnmount();
|
|
23
18
|
//unmount
|
|
24
19
|
while (controller.root.hasChildNodes()) {
|
|
25
20
|
controller.root.removeChild(controller.root.firstChild);
|
|
26
21
|
}
|
|
27
22
|
//beforeMount
|
|
28
|
-
var beforeMount = controller.proto.getBeforeMount().bind(
|
|
23
|
+
var beforeMount = controller.proto.getBeforeMount().bind(controller.raw_data);
|
|
29
24
|
beforeMount();
|
|
30
25
|
//mount
|
|
31
26
|
while (tagTemplate.hasChildNodes()) {
|
|
32
27
|
controller.root.appendChild(tagTemplate.firstChild);
|
|
33
28
|
}
|
|
34
29
|
//afterRender
|
|
35
|
-
var afterRender = controller.proto.getAfterRender().bind(
|
|
30
|
+
var afterRender = controller.proto.getAfterRender().bind(controller.raw_data);
|
|
36
31
|
afterRender();
|
|
37
32
|
//获取定位
|
|
38
33
|
bindModelForUpdater(controller.root.children, controller.proxyForMethods);
|
package/index.js
CHANGED
|
@@ -73,6 +73,7 @@ var RenderJS = /** @class */ (function () {
|
|
|
73
73
|
});
|
|
74
74
|
Reflect.set(window, "styleLib", styleLib);
|
|
75
75
|
Reflect.set(window, "context", new App());
|
|
76
|
+
Reflect.set(window, "router", this.routerC);
|
|
76
77
|
//开始渲染
|
|
77
78
|
renderHtml(document.body.children, this.page);
|
|
78
79
|
window.onload = reloadPage.bind(this);
|