render-core 1.0.33 → 1.0.35

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(): string;
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?: string;
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(): string;
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,8 @@ 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
+ renderSpace.setAttribute("style", proto.getBoxStyle());
35
37
  //指定渲染空间
36
38
  controller.root = renderSpace;
37
39
  //开始渲染
@@ -78,6 +80,8 @@ export function post_render(proto, parent, child, link, tagTemplate) {
78
80
  beforeMount();
79
81
  //mount
80
82
  var renderSpace = document.createElement("div");
83
+ //给box添加样式
84
+ renderSpace.setAttribute("style", proto.getBoxStyle());
81
85
  //指定渲染空间
82
86
  controller.root = renderSpace;
83
87
  //开始渲染
@@ -123,6 +127,8 @@ export function raw_render(proto, parent, child, link, tagTemplate) {
123
127
  beforeMount();
124
128
  //mount
125
129
  var renderSpace = document.createElement("div");
130
+ //给box添加样式
131
+ renderSpace.setAttribute("style", proto.getBoxStyle());
126
132
  //指定渲染空间
127
133
  controller.root = renderSpace;
128
134
  //开始渲染
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "render-core",
3
- "version": "1.0.33",
3
+ "version": "1.0.35",
4
4
  "description": "The core for render-js",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",