render-core 1.3.38 → 1.3.40
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/class/component/component.d.ts +41 -41
- package/class/component/component.js +108 -108
- package/class/controller/appController.d.ts +17 -44
- package/class/controller/appController.js +25 -132
- package/class/controller/componentController.d.ts +15 -15
- package/class/controller/componentController.js +22 -22
- package/class/controller/pageController.d.ts +23 -23
- package/class/controller/pageController.js +40 -40
- package/class/tips/appTip.d.ts +2 -2
- package/class/tips/appTip.js +1 -1
- package/class/tips/componentTip.d.ts +13 -13
- package/class/tips/componentTip.js +1 -1
- package/class/tips/renderTip.d.ts +3 -5
- package/class/tips/renderTip.js +1 -1
- package/core/cmd/data/v-el.d.ts +8 -8
- package/core/cmd/data/v-el.js +28 -28
- package/core/cmd/data/v-html.d.ts +8 -8
- package/core/cmd/data/v-html.js +26 -26
- package/core/cmd/data/v-txt.d.ts +8 -8
- package/core/cmd/data/v-txt.js +29 -29
- package/core/cmd/justify/v-if.d.ts +6 -6
- package/core/cmd/justify/v-if.js +43 -43
- package/core/cmd/justify/v-render.d.ts +6 -6
- package/core/cmd/justify/v-render.js +26 -26
- package/core/cmd/justify/v-show.d.ts +6 -6
- package/core/cmd/justify/v-show.js +26 -26
- package/core/cmd/justify/v-switch.d.ts +6 -6
- package/core/cmd/justify/v-switch.js +35 -35
- package/core/cmd/loop/v-for.d.ts +12 -12
- package/core/cmd/loop/v-for.js +63 -63
- package/core/cmd/loop/v-index.d.ts +14 -14
- package/core/cmd/loop/v-index.js +80 -79
- package/core/cmd/loop/v-key.d.ts +12 -12
- package/core/cmd/loop/v-key.js +70 -70
- package/core/cmd/method/v-on.d.ts +8 -8
- package/core/cmd/method/v-on.js +40 -40
- package/core/cmd/property/v-bind.d.ts +6 -6
- package/core/cmd/property/v-bind.js +33 -33
- package/core/cmd/react/v-model.d.ts +6 -6
- package/core/cmd/react/v-model.js +22 -22
- package/core/cmd/ref/v-ref.d.ts +6 -6
- package/core/cmd/ref/v-ref.js +16 -16
- package/core/cmd/solt/v-solt.d.ts +14 -14
- package/core/cmd/solt/v-solt.js +46 -46
- package/core/inject/inject.d.ts +30 -35
- package/core/inject/inject.js +63 -70
- package/core/lifecycle/afterMethods.d.ts +16 -16
- package/core/lifecycle/afterMethods.js +22 -22
- package/core/lifecycle/controllerCycle.d.ts +13 -13
- package/core/lifecycle/controllerCycle.js +42 -42
- package/core/lifecycle/mount.d.ts +16 -17
- package/core/lifecycle/mount.js +31 -34
- package/core/loader/loader.d.ts +7 -7
- package/core/loader/loader.js +18 -18
- package/core/proxy/getProxy.d.ts +13 -13
- package/core/proxy/getProxy.js +42 -42
- package/core/render/PostRender.d.ts +12 -12
- package/core/render/PostRender.js +42 -45
- package/core/render/delivery.d.ts +5 -5
- package/core/render/delivery.js +42 -42
- package/core/render/initRender.d.ts +12 -12
- package/core/render/initRender.js +39 -41
- package/core/render/partRender.d.ts +15 -15
- package/core/render/partRender.js +31 -31
- package/core/render/rawRender.d.ts +12 -12
- package/core/render/rawRender.js +43 -45
- package/core/render/updateRender.d.ts +6 -6
- package/core/render/updateRender.js +29 -32
- package/core/resolver/props.d.ts +18 -18
- package/core/resolver/props.js +60 -60
- package/core/resolver/query.d.ts +4 -4
- package/core/resolver/query.js +15 -15
- package/core/utility/checkUtility.d.ts +1 -1
- package/core/utility/checkUtility.js +4 -4
- package/core/utility/cmdUtility.d.ts +16 -16
- package/core/utility/cmdUtility.js +57 -57
- package/core/utility/dataUtility.d.ts +1 -1
- package/core/utility/dataUtility.js +8 -8
- package/core/utility/errorUtility.d.ts +3 -3
- package/core/utility/errorUtility.js +9 -9
- package/core/utility/injectUtility.d.ts +13 -13
- package/core/utility/injectUtility.js +58 -58
- package/core/utility/inputType.d.ts +5 -5
- package/core/utility/inputType.js +20 -20
- package/core/utility/inputUtility.d.ts +4 -4
- package/core/utility/inputUtility.js +100 -100
- package/core/utility/miscUtility.d.ts +6 -6
- package/core/utility/miscUtility.js +12 -12
- package/core/utility/modelUtility.d.ts +15 -15
- package/core/utility/modelUtility.js +66 -66
- package/core/utility/sectionUtility.d.ts +6 -6
- package/core/utility/sectionUtility.js +104 -104
- package/core/utility/styleUtility.d.ts +17 -29
- package/core/utility/styleUtility.js +67 -114
- package/core/utility/templateUtility.d.ts +6 -6
- package/core/utility/templateUtility.js +13 -13
- package/core/utility/vForUtility.d.ts +15 -15
- package/core/utility/vForUtility.js +20 -20
- package/http/redirect/redirect.d.ts +11 -11
- package/http/redirect/redirect.js +36 -36
- package/index.d.ts +44 -71
- package/index.js +70 -130
- package/package.json +3 -8
- package/runtime/metaTagLib.d.ts +2 -2
- package/runtime/metaTagLib.js +27 -27
- package/runtime/runtime.d.ts +7 -7
- package/runtime/runtime.js +26 -26
- package/runtime/tools.d.ts +14 -14
- package/runtime/tools.js +43 -49
- package/README.md +0 -2
- package/class/controller/contextController.d.ts +0 -18
- package/class/controller/contextController.js +0 -79
- package/func/Theme.d.ts +0 -16
- package/func/Theme.js +0 -27
- package/status/read/read.d.ts +0 -10
- package/status/read/read.js +0 -26
- package/status/write/write.d.ts +0 -12
- package/status/write/write.js +0 -92
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
var PageController = /** @class */ (function () {
|
|
2
|
-
//构造函数
|
|
3
|
-
function PageController() {
|
|
4
|
-
//注入系统方法
|
|
5
|
-
this.methods = Reflect.get(window, "pageMethods");
|
|
6
|
-
this.link = new Map();
|
|
7
|
-
this.to = Array();
|
|
8
|
-
this.crtTag = null;
|
|
9
|
-
this.solt = new Map();
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @param method
|
|
14
|
-
* @param args
|
|
15
|
-
*/
|
|
16
|
-
PageController.prototype.receiver = function (method) {
|
|
17
|
-
var args = [];
|
|
18
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
19
|
-
args[_i - 1] = arguments[_i];
|
|
20
|
-
}
|
|
21
|
-
Reflect.get(window, method).call(window, args);
|
|
22
|
-
};
|
|
23
|
-
Object.defineProperty(PageController.prototype, "crtTag", {
|
|
24
|
-
//返回当前页面的渲染元素
|
|
25
|
-
get: function () {
|
|
26
|
-
return this.currentTag;
|
|
27
|
-
},
|
|
28
|
-
/**
|
|
29
|
-
*
|
|
30
|
-
* @param element
|
|
31
|
-
*/
|
|
32
|
-
set: function (element) {
|
|
33
|
-
this.currentTag = element;
|
|
34
|
-
},
|
|
35
|
-
enumerable: false,
|
|
36
|
-
configurable: true
|
|
37
|
-
});
|
|
38
|
-
return PageController;
|
|
39
|
-
}());
|
|
40
|
-
export { PageController };
|
|
1
|
+
var PageController = /** @class */ (function () {
|
|
2
|
+
//构造函数
|
|
3
|
+
function PageController() {
|
|
4
|
+
//注入系统方法
|
|
5
|
+
this.methods = Reflect.get(window, "pageMethods");
|
|
6
|
+
this.link = new Map();
|
|
7
|
+
this.to = Array();
|
|
8
|
+
this.crtTag = null;
|
|
9
|
+
this.solt = new Map();
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @param method
|
|
14
|
+
* @param args
|
|
15
|
+
*/
|
|
16
|
+
PageController.prototype.receiver = function (method) {
|
|
17
|
+
var args = [];
|
|
18
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
19
|
+
args[_i - 1] = arguments[_i];
|
|
20
|
+
}
|
|
21
|
+
Reflect.get(window, method).call(window, args);
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(PageController.prototype, "crtTag", {
|
|
24
|
+
//返回当前页面的渲染元素
|
|
25
|
+
get: function () {
|
|
26
|
+
return this.currentTag;
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param element
|
|
31
|
+
*/
|
|
32
|
+
set: function (element) {
|
|
33
|
+
this.currentTag = element;
|
|
34
|
+
},
|
|
35
|
+
enumerable: false,
|
|
36
|
+
configurable: true
|
|
37
|
+
});
|
|
38
|
+
return PageController;
|
|
39
|
+
}());
|
|
40
|
+
export { PageController };
|
package/class/tips/appTip.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export interface AppTip {
|
|
2
|
-
}
|
|
1
|
+
export interface AppTip {
|
|
2
|
+
}
|
package/class/tips/appTip.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export interface RenderBase {
|
|
2
|
-
getName(): string;
|
|
3
|
-
getTemplate(): string;
|
|
4
|
-
getMode(): string;
|
|
5
|
-
getBoxStyle(): string;
|
|
6
|
-
getProps(): {};
|
|
7
|
-
getData(): {};
|
|
8
|
-
getComputed(): {};
|
|
9
|
-
getMethods(): {};
|
|
10
|
-
getWatcher(): {};
|
|
11
|
-
getBeforeRender(): () => void;
|
|
12
|
-
getAfterRender(): () => void;
|
|
13
|
-
}
|
|
1
|
+
export interface RenderBase {
|
|
2
|
+
getName(): string;
|
|
3
|
+
getTemplate(): string;
|
|
4
|
+
getMode(): string;
|
|
5
|
+
getBoxStyle(): string;
|
|
6
|
+
getProps(): {};
|
|
7
|
+
getData(): {};
|
|
8
|
+
getComputed(): {};
|
|
9
|
+
getMethods(): {};
|
|
10
|
+
getWatcher(): {};
|
|
11
|
+
getBeforeRender(): () => void;
|
|
12
|
+
getAfterRender(): () => void;
|
|
13
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/class/tips/renderTip.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/core/cmd/data/v-el.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ComponentController } from "../../../class/controller/componentController";
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @param node
|
|
5
|
-
* @param data
|
|
6
|
-
* @param controller
|
|
7
|
-
*/
|
|
8
|
-
export declare function resolver_experssion(node: ParentNode, data: {}, controller: ComponentController): void;
|
|
1
|
+
import { ComponentController } from "../../../class/controller/componentController";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param node
|
|
5
|
+
* @param data
|
|
6
|
+
* @param controller
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolver_experssion(node: ParentNode, data: {}, controller: ComponentController): void;
|
package/core/cmd/data/v-el.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param node
|
|
4
|
-
* @param data
|
|
5
|
-
* @param controller
|
|
6
|
-
*/
|
|
7
|
-
export function resolver_experssion(node, data, controller) {
|
|
8
|
-
if (node.hasChildNodes()) {
|
|
9
|
-
for (var j = 0; j < node.childNodes.length; j++) {
|
|
10
|
-
if (node.childNodes[j].nodeType === 3) {
|
|
11
|
-
var result = node.childNodes[j].nodeValue.match(/\{\{([a-zA-Z]+)}}/g);
|
|
12
|
-
if (result) {
|
|
13
|
-
var property = result[0].replace(/\{/g, "").replace(/}/g, "");
|
|
14
|
-
try {
|
|
15
|
-
node.childNodes[j].nodeValue = data[property];
|
|
16
|
-
}
|
|
17
|
-
catch (e) {
|
|
18
|
-
node.childNodes[j].nodeValue = controller.computed[property]();
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
else if (node.childNodes[j].nodeType === 1) {
|
|
23
|
-
// @ts-ignore
|
|
24
|
-
resolver_experssion(node.childNodes[j], data, controller);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param node
|
|
4
|
+
* @param data
|
|
5
|
+
* @param controller
|
|
6
|
+
*/
|
|
7
|
+
export function resolver_experssion(node, data, controller) {
|
|
8
|
+
if (node.hasChildNodes()) {
|
|
9
|
+
for (var j = 0; j < node.childNodes.length; j++) {
|
|
10
|
+
if (node.childNodes[j].nodeType === 3) {
|
|
11
|
+
var result = node.childNodes[j].nodeValue.match(/\{\{([a-zA-Z]+)}}/g);
|
|
12
|
+
if (result) {
|
|
13
|
+
var property = result[0].replace(/\{/g, "").replace(/}/g, "");
|
|
14
|
+
try {
|
|
15
|
+
node.childNodes[j].nodeValue = data[property];
|
|
16
|
+
}
|
|
17
|
+
catch (e) {
|
|
18
|
+
node.childNodes[j].nodeValue = controller.computed[property]();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else if (node.childNodes[j].nodeType === 1) {
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
resolver_experssion(node.childNodes[j], data, controller);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ComponentController } from "../../../class/controller/componentController";
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @param elements
|
|
5
|
-
* @param data
|
|
6
|
-
* @param controller
|
|
7
|
-
*/
|
|
8
|
-
export declare function resolver_html(elements: HTMLCollection, data: {}, controller: ComponentController): void;
|
|
1
|
+
import { ComponentController } from "../../../class/controller/componentController";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param elements
|
|
5
|
+
* @param data
|
|
6
|
+
* @param controller
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolver_html(elements: HTMLCollection, data: {}, controller: ComponentController): void;
|
package/core/cmd/data/v-html.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param elements
|
|
4
|
-
* @param data
|
|
5
|
-
* @param controller
|
|
6
|
-
*/
|
|
7
|
-
export function resolver_html(elements, data, controller) {
|
|
8
|
-
for (var i = 0; i < elements.length; i++) {
|
|
9
|
-
if (elements[i].hasAttribute("@html")) {
|
|
10
|
-
var dataName = elements[i].getAttribute("@html");
|
|
11
|
-
elements[i].removeAttribute("@html");
|
|
12
|
-
try {
|
|
13
|
-
if (data[dataName] === undefined) {
|
|
14
|
-
elements[i].innerHTML = controller.computed[dataName]();
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
elements[i].innerHTML = data[dataName];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
catch (error) {
|
|
21
|
-
console.error("Can not find data:" + dataName + " in the component");
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
resolver_html(elements[i].children, data, controller);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param elements
|
|
4
|
+
* @param data
|
|
5
|
+
* @param controller
|
|
6
|
+
*/
|
|
7
|
+
export function resolver_html(elements, data, controller) {
|
|
8
|
+
for (var i = 0; i < elements.length; i++) {
|
|
9
|
+
if (elements[i].hasAttribute("@html")) {
|
|
10
|
+
var dataName = elements[i].getAttribute("@html");
|
|
11
|
+
elements[i].removeAttribute("@html");
|
|
12
|
+
try {
|
|
13
|
+
if (data[dataName] === undefined) {
|
|
14
|
+
elements[i].innerHTML = controller.computed[dataName]();
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
elements[i].innerHTML = data[dataName];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
console.error("Can not find data:" + dataName + " in the component");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
resolver_html(elements[i].children, data, controller);
|
|
25
|
+
}
|
|
26
|
+
}
|
package/core/cmd/data/v-txt.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ComponentController } from "../../../class/controller/componentController";
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @param elements
|
|
5
|
-
* @param data
|
|
6
|
-
* @param controller
|
|
7
|
-
*/
|
|
8
|
-
export declare function resolver_txt(elements: HTMLCollection, data: {}, controller: ComponentController): void;
|
|
1
|
+
import { ComponentController } from "../../../class/controller/componentController";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param elements
|
|
5
|
+
* @param data
|
|
6
|
+
* @param controller
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolver_txt(elements: HTMLCollection, data: {}, controller: ComponentController): void;
|
package/core/cmd/data/v-txt.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param elements
|
|
4
|
-
* @param data
|
|
5
|
-
* @param controller
|
|
6
|
-
*/
|
|
7
|
-
export function resolver_txt(elements, data, controller) {
|
|
8
|
-
for (var i = 0; i < elements.length; i++) {
|
|
9
|
-
var result = elements[i].hasAttribute("@txt");
|
|
10
|
-
if (result) {
|
|
11
|
-
var dataName = elements[i].getAttribute("@txt");
|
|
12
|
-
elements[i].removeAttribute("@txt");
|
|
13
|
-
try {
|
|
14
|
-
if (data[dataName] === undefined) {
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
elements[i].innerText = controller.computed[dataName]();
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
// @ts-ignore
|
|
20
|
-
elements[i].innerText = data[dataName];
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
catch (error) {
|
|
24
|
-
console.error("Can not find data:" + dataName + " in the component");
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
resolver_txt(elements[i].children, data, controller);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param elements
|
|
4
|
+
* @param data
|
|
5
|
+
* @param controller
|
|
6
|
+
*/
|
|
7
|
+
export function resolver_txt(elements, data, controller) {
|
|
8
|
+
for (var i = 0; i < elements.length; i++) {
|
|
9
|
+
var result = elements[i].hasAttribute("@txt");
|
|
10
|
+
if (result) {
|
|
11
|
+
var dataName = elements[i].getAttribute("@txt");
|
|
12
|
+
elements[i].removeAttribute("@txt");
|
|
13
|
+
try {
|
|
14
|
+
if (data[dataName] === undefined) {
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
elements[i].innerText = controller.computed[dataName]();
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
elements[i].innerText = data[dataName];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
console.error("Can not find data:" + dataName + " in the component");
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
resolver_txt(elements[i].children, data, controller);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param elements
|
|
4
|
-
* @param data
|
|
5
|
-
*/
|
|
6
|
-
export declare function resolver_if(elements: HTMLCollection, data: {}): void;
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param elements
|
|
4
|
+
* @param data
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolver_if(elements: HTMLCollection, data: {}): void;
|
package/core/cmd/justify/v-if.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param elements
|
|
4
|
-
* @param data
|
|
5
|
-
*/
|
|
6
|
-
export function resolver_if(elements, data) {
|
|
7
|
-
var tag = false;
|
|
8
|
-
//在当前级别下寻找到v-if
|
|
9
|
-
for (var i = 0; i < elements.length; i++) {
|
|
10
|
-
var result = elements[i].hasAttribute("@if");
|
|
11
|
-
if (result) {
|
|
12
|
-
var dataName = elements[i].getAttribute("@if");
|
|
13
|
-
elements[i].removeAttribute("@if");
|
|
14
|
-
if (data[dataName] === true) {
|
|
15
|
-
// @ts-ignore
|
|
16
|
-
break;
|
|
17
|
-
}
|
|
18
|
-
else if (data[dataName] === false) {
|
|
19
|
-
// @ts-ignore
|
|
20
|
-
elements[i].style.display = "none";
|
|
21
|
-
tag = true;
|
|
22
|
-
break;
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
console.log("v-if instruction should be used with boolean!");
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
resolver_if(elements[i].children, data);
|
|
30
|
-
}
|
|
31
|
-
//v-if渲染失败,寻找到是否匹配的v-else
|
|
32
|
-
for (var j = 0; j < elements.length; j++) {
|
|
33
|
-
var result = elements[j].hasAttribute("v-else");
|
|
34
|
-
if (result) {
|
|
35
|
-
elements[j].removeAttribute("v-else");
|
|
36
|
-
if (tag) {
|
|
37
|
-
// @ts-ignore
|
|
38
|
-
elements[j].style.display = "none";
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param elements
|
|
4
|
+
* @param data
|
|
5
|
+
*/
|
|
6
|
+
export function resolver_if(elements, data) {
|
|
7
|
+
var tag = false;
|
|
8
|
+
//在当前级别下寻找到v-if
|
|
9
|
+
for (var i = 0; i < elements.length; i++) {
|
|
10
|
+
var result = elements[i].hasAttribute("@if");
|
|
11
|
+
if (result) {
|
|
12
|
+
var dataName = elements[i].getAttribute("@if");
|
|
13
|
+
elements[i].removeAttribute("@if");
|
|
14
|
+
if (data[dataName] === true) {
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
else if (data[dataName] === false) {
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
elements[i].style.display = "none";
|
|
21
|
+
tag = true;
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
console.log("v-if instruction should be used with boolean!");
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
resolver_if(elements[i].children, data);
|
|
30
|
+
}
|
|
31
|
+
//v-if渲染失败,寻找到是否匹配的v-else
|
|
32
|
+
for (var j = 0; j < elements.length; j++) {
|
|
33
|
+
var result = elements[j].hasAttribute("v-else");
|
|
34
|
+
if (result) {
|
|
35
|
+
elements[j].removeAttribute("v-else");
|
|
36
|
+
if (tag) {
|
|
37
|
+
// @ts-ignore
|
|
38
|
+
elements[j].style.display = "none";
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param elements
|
|
4
|
-
* @param data
|
|
5
|
-
*/
|
|
6
|
-
export declare function resolver_render(elements: HTMLCollection, data: {}): void;
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param elements
|
|
4
|
+
* @param data
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolver_render(elements: HTMLCollection, data: {}): void;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param elements
|
|
4
|
-
* @param data
|
|
5
|
-
*/
|
|
6
|
-
export function resolver_render(elements, data) {
|
|
7
|
-
for (var i = 0; i < elements.length; i++) {
|
|
8
|
-
var result = elements[i].hasAttribute("@render");
|
|
9
|
-
if (result) {
|
|
10
|
-
var dataName = elements[i].getAttribute("@render");
|
|
11
|
-
elements[i].removeAttribute("@render");
|
|
12
|
-
if (data[dataName] === true) {
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
elements[i].style.display = "block";
|
|
15
|
-
}
|
|
16
|
-
else if (data[dataName] === false) {
|
|
17
|
-
// @ts-ignore
|
|
18
|
-
elements[i].style.display = "none";
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
console.log("@render instruct should be used with boolean!");
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
resolver_render(elements[i].children, data);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param elements
|
|
4
|
+
* @param data
|
|
5
|
+
*/
|
|
6
|
+
export function resolver_render(elements, data) {
|
|
7
|
+
for (var i = 0; i < elements.length; i++) {
|
|
8
|
+
var result = elements[i].hasAttribute("@render");
|
|
9
|
+
if (result) {
|
|
10
|
+
var dataName = elements[i].getAttribute("@render");
|
|
11
|
+
elements[i].removeAttribute("@render");
|
|
12
|
+
if (data[dataName] === true) {
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
elements[i].style.display = "block";
|
|
15
|
+
}
|
|
16
|
+
else if (data[dataName] === false) {
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
elements[i].style.display = "none";
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
console.log("@render instruct should be used with boolean!");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
resolver_render(elements[i].children, data);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param elements
|
|
4
|
-
* @param data
|
|
5
|
-
*/
|
|
6
|
-
export declare function resolver_show(elements: HTMLCollection, data: {}): void;
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param elements
|
|
4
|
+
* @param data
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolver_show(elements: HTMLCollection, data: {}): void;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param elements
|
|
4
|
-
* @param data
|
|
5
|
-
*/
|
|
6
|
-
export function resolver_show(elements, data) {
|
|
7
|
-
for (var i = 0; i < elements.length; i++) {
|
|
8
|
-
var result = elements[i].hasAttribute("@show");
|
|
9
|
-
if (result) {
|
|
10
|
-
var dataName = elements[i].getAttribute("@show");
|
|
11
|
-
elements[i].removeAttribute("@show");
|
|
12
|
-
if (data[dataName] === true) {
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
elements[i].style.visibility = "visible";
|
|
15
|
-
}
|
|
16
|
-
else if (data[dataName] === false) {
|
|
17
|
-
// @ts-ignore
|
|
18
|
-
elements[i].style.visibility = "hidden";
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
console.log("@show instruct should be used with boolean!");
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
resolver_show(elements[i].children, data);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param elements
|
|
4
|
+
* @param data
|
|
5
|
+
*/
|
|
6
|
+
export function resolver_show(elements, data) {
|
|
7
|
+
for (var i = 0; i < elements.length; i++) {
|
|
8
|
+
var result = elements[i].hasAttribute("@show");
|
|
9
|
+
if (result) {
|
|
10
|
+
var dataName = elements[i].getAttribute("@show");
|
|
11
|
+
elements[i].removeAttribute("@show");
|
|
12
|
+
if (data[dataName] === true) {
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
elements[i].style.visibility = "visible";
|
|
15
|
+
}
|
|
16
|
+
else if (data[dataName] === false) {
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
elements[i].style.visibility = "hidden";
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
console.log("@show instruct should be used with boolean!");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
resolver_show(elements[i].children, data);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param elements
|
|
4
|
-
* @param data
|
|
5
|
-
*/
|
|
6
|
-
export declare function resolver_switch(elements: HTMLCollection, data: {}): void;
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param elements
|
|
4
|
+
* @param data
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolver_switch(elements: HTMLCollection, data: {}): void;
|