render-core 1.0.33 → 1.0.34

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
  interface RenderBase {
2
2
  getName(): string;
3
3
  getTemplate(): string;
4
+ getBoxStyle(): {};
4
5
  getProps(): {};
5
6
  getData(): {};
6
7
  getComputed(): {};
@@ -16,6 +17,7 @@ interface RenderBase {
16
17
  export declare class Component implements RenderBase {
17
18
  private readonly name;
18
19
  private readonly template;
20
+ private readonly boxStyle?;
19
21
  private readonly props?;
20
22
  private readonly data?;
21
23
  private readonly methods?;
@@ -30,6 +32,7 @@ export declare class Component implements RenderBase {
30
32
  constructor(config: {
31
33
  name: string;
32
34
  template: string;
35
+ boxStyle?: {};
33
36
  props?: {} | string[];
34
37
  data?: {};
35
38
  computed?: {};
@@ -44,6 +47,7 @@ export declare class Component implements RenderBase {
44
47
  });
45
48
  getName(): string;
46
49
  getTemplate(): string;
50
+ getBoxStyle(): {};
47
51
  getProps(): {};
48
52
  getData(): {};
49
53
  getMethods(): {};
@@ -4,6 +4,13 @@ var Component = /** @class */ (function () {
4
4
  this.name = config.name;
5
5
  //标签模板样式
6
6
  this.template = config.template;
7
+ //添加box样式
8
+ if (typeof config.boxStyle === "undefined") {
9
+ this.boxStyle = {};
10
+ }
11
+ else {
12
+ this.boxStyle = config.boxStyle;
13
+ }
7
14
  //添加数据
8
15
  if (typeof config.props === "undefined") {
9
16
  this.props = [];
@@ -19,7 +26,7 @@ var Component = /** @class */ (function () {
19
26
  this.data = config.data;
20
27
  }
21
28
  //添加计算属性
22
- if (config.computed === "undefined") {
29
+ if (typeof config.computed === "undefined") {
23
30
  this.computed = {};
24
31
  }
25
32
  else {
@@ -83,6 +90,9 @@ var Component = /** @class */ (function () {
83
90
  Component.prototype.getTemplate = function () {
84
91
  return this.template;
85
92
  };
93
+ Component.prototype.getBoxStyle = function () {
94
+ return this.boxStyle;
95
+ };
86
96
  Component.prototype.getProps = function () {
87
97
  return this.props;
88
98
  };
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Component } from "./class/component";
2
2
  import meta from "./meta/meta";
3
- import { reloadPage, renderHtml } from "./runtime/runtime";
3
+ import { renderHtml } from "./runtime/runtime";
4
4
  import { themeStyle } from "./core/utility/styleUtility";
5
5
  // @ts-ignore
6
6
  import { redirect } from "render-security/utility/redirect";
@@ -76,7 +76,6 @@ var RenderJS = /** @class */ (function () {
76
76
  Reflect.set(window, "router", this.routerC);
77
77
  //开始渲染
78
78
  renderHtml(document.body.children, this.page);
79
- window.onload = reloadPage.bind(this);
80
79
  };
81
80
  return RenderJS;
82
81
  }());
@@ -32,6 +32,10 @@ export function init_render(proto, parent, child, link, tagTemplate) {
32
32
  beforeMount();
33
33
  //mount
34
34
  var renderSpace = document.createElement("div");
35
+ //给box添加样式
36
+ for (var boxStyleKey in proto.getBoxStyle()) {
37
+ renderSpace["style"].setProperty(boxStyleKey, proto.getBoxStyle()[boxStyleKey]);
38
+ }
35
39
  //指定渲染空间
36
40
  controller.root = renderSpace;
37
41
  //开始渲染
@@ -78,6 +82,10 @@ export function post_render(proto, parent, child, link, tagTemplate) {
78
82
  beforeMount();
79
83
  //mount
80
84
  var renderSpace = document.createElement("div");
85
+ //给box添加样式
86
+ for (var boxStyleKey in proto.getBoxStyle()) {
87
+ renderSpace["style"].setProperty(boxStyleKey, proto.getBoxStyle()[boxStyleKey]);
88
+ }
81
89
  //指定渲染空间
82
90
  controller.root = renderSpace;
83
91
  //开始渲染
@@ -123,6 +131,10 @@ export function raw_render(proto, parent, child, link, tagTemplate) {
123
131
  beforeMount();
124
132
  //mount
125
133
  var renderSpace = document.createElement("div");
134
+ //给box添加样式
135
+ for (var boxStyleKey in proto.getBoxStyle()) {
136
+ renderSpace["style"].setProperty(boxStyleKey, proto.getBoxStyle()[boxStyleKey]);
137
+ }
126
138
  //指定渲染空间
127
139
  controller.root = renderSpace;
128
140
  //开始渲染
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "render-core",
3
- "version": "1.0.33",
3
+ "version": "1.0.34",
4
4
  "description": "The core for render-js",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",