render-core 1.2.3 → 1.2.5

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.
@@ -1,6 +1,7 @@
1
1
  import { inject, injectComputed, injectMethod, injectWatcher } from "../inject/inject";
2
2
  import { getProxyObject } from "../proxy/getProxy";
3
3
  import { getCodeSpaceForCommit, getCodeSpaceForProperty, getCodeSpaceForPublish, getCommitMethod, getPublishMethod, getSetterMethod } from "../utility/injectUtility";
4
+ import { dataInject } from "../utility/dataUtility";
4
5
  /**
5
6
  * This function is used to initiate the component controller object.
6
7
  * @param controller
@@ -16,7 +17,7 @@ export function controllerCycleTypeOne(controller, proto, child, link, tagTempla
16
17
  }
17
18
  export function controllerCycleTypeTwo(controller, proto, child, link, tagTemplate) {
18
19
  //复制原始数据对象到控制对象
19
- controller.raw_data = Object.create(proto.getData());
20
+ controller.raw_data = dataInject(proto.getData());
20
21
  cycleBridge(controller, proto, child, link, tagTemplate);
21
22
  }
22
23
  function cycleBridge(controller, proto, child, link, tagTemplate) {
@@ -33,7 +33,7 @@ export function post_render(proto, parent, child, link, tagTemplate) {
33
33
  //后处理
34
34
  afterMethodsTypeOne(controller, child, link);
35
35
  //afterRender
36
- proto.getAfterRender().call(controller.raw_data);
36
+ proto.getAfterRender().call(controller.proxyForMethods);
37
37
  //深度渲染
38
38
  findComponent(controller.root.children, controller);
39
39
  if (proto.getMode() === "insert") {
@@ -34,7 +34,7 @@ export function raw_render(proto, parent, child, link, tagTemplate) {
34
34
  //后处理(数据渲染)
35
35
  afterMethodsTypeTwo(controller, child, link);
36
36
  //afterRender,可以操作渲染后的dom
37
- proto.getAfterRender().call(controller.raw_data);
37
+ proto.getAfterRender().call(controller.proxyForMethods);
38
38
  //深度渲染
39
39
  findComponent(controller.root.children, controller);
40
40
  if (proto.getMode() === "insert") {
@@ -0,0 +1 @@
1
+ export declare function dataInject(data: any): any;
@@ -0,0 +1,8 @@
1
+ export function dataInject(data) {
2
+ var out = {};
3
+ var keys = data.getOwnPropertyNames();
4
+ keys.forEach(function (value) {
5
+ out[value] = data[value];
6
+ });
7
+ return out;
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "render-core",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "description": "The core of render-js",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",