render-core 1.3.42 → 1.3.43
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/utility/miscUtility.d.ts +6 -0
- package/core/utility/miscUtility.js +8 -0
- package/index.js +4 -2
- package/package.json +1 -1
|
@@ -4,3 +4,9 @@
|
|
|
4
4
|
* @param component
|
|
5
5
|
*/
|
|
6
6
|
export declare function addLabel(nodes: HTMLCollection, component: string): void;
|
|
7
|
+
/**
|
|
8
|
+
* Use the func to register some tool-functions to the windows object.
|
|
9
|
+
* @param name
|
|
10
|
+
* @param func
|
|
11
|
+
*/
|
|
12
|
+
export declare function registerElements(name: string, func: any): void;
|
|
@@ -10,3 +10,11 @@ export function addLabel(nodes, component) {
|
|
|
10
10
|
addLabel(kk, component);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Use the func to register some tool-functions to the windows object.
|
|
15
|
+
* @param name
|
|
16
|
+
* @param func
|
|
17
|
+
*/
|
|
18
|
+
export function registerElements(name, func) {
|
|
19
|
+
Reflect.set(window, name, func);
|
|
20
|
+
}
|
package/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { PageController } from "./class/controller/pageController";
|
|
|
2
2
|
import { registerTagLib, render } from "./runtime/tools";
|
|
3
3
|
import { AppController } from "./class/controller/appController";
|
|
4
4
|
import { changeStyle, changeTheme } from "./core/utility/styleUtility";
|
|
5
|
+
import { registerElements } from "./core/utility/miscUtility";
|
|
5
6
|
/**
|
|
6
7
|
* This class is the application class.
|
|
7
8
|
*/
|
|
@@ -46,9 +47,10 @@ var RenderJS = /** @class */ (function () {
|
|
|
46
47
|
//挂载对象
|
|
47
48
|
this.mount();
|
|
48
49
|
//注册函数
|
|
49
|
-
|
|
50
|
+
registerElements("changeStyle", changeStyle);
|
|
50
51
|
//注册函数
|
|
51
|
-
|
|
52
|
+
registerElements("changeTheme", changeTheme);
|
|
53
|
+
//plugin
|
|
52
54
|
this.use(function (render) {
|
|
53
55
|
sessionStorage.setItem("theme_style", "default");
|
|
54
56
|
});
|