render-core 1.0.27 → 1.0.28

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.
@@ -31,7 +31,7 @@ export declare class Component implements RenderBase {
31
31
  name: string;
32
32
  template: string;
33
33
  props?: {} | string[];
34
- data?: {};
34
+ data?: () => {};
35
35
  computed?: {};
36
36
  methods?: {};
37
37
  watcher?: {};
@@ -13,7 +13,7 @@ var Component = /** @class */ (function () {
13
13
  }
14
14
  //添加数据
15
15
  if (typeof config.data == "undefined") {
16
- this.data = {};
16
+ this.data = function () { return {}; };
17
17
  }
18
18
  else {
19
19
  this.data = config.data;
@@ -87,7 +87,7 @@ var Component = /** @class */ (function () {
87
87
  return this.props;
88
88
  };
89
89
  Component.prototype.getData = function () {
90
- return this.data;
90
+ return this.data();
91
91
  };
92
92
  Component.prototype.getMethods = function () {
93
93
  return this.methods;
@@ -48,7 +48,7 @@ export function post_render(proto, parent, child, link, tagTemplate) {
48
48
  //保持控制器模板对象
49
49
  controller.proto = proto;
50
50
  //复制原始数据对象到控制对象
51
- controller.raw_data = Object.create(proto.getData());
51
+ controller.raw_data = proto.getData();
52
52
  //向raw_data中注入元数据
53
53
  inject(controller, tagTemplate);
54
54
  //保持数据代理对象
@@ -87,7 +87,7 @@ export function raw_render(proto, parent, child, link, tagTemplate) {
87
87
  //向raw_data中注入元数据
88
88
  inject(controller, tagTemplate);
89
89
  //复制原始数据对象到控制对象
90
- controller.raw_data = Object.create(proto.getData());
90
+ controller.raw_data = proto.getData();
91
91
  //数据渲染对象
92
92
  controller.proxyForMethods = getProxyObject(controller.raw_data, controller);
93
93
  //注入commit
@@ -1,7 +1,7 @@
1
1
  export declare function extendTag(component: {
2
2
  name: string;
3
3
  template: string;
4
- data?: {};
4
+ data?: () => {};
5
5
  computed?: {};
6
6
  methods?: {};
7
7
  components?: {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "render-core",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "The router for render-js",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",