render-core 1.3.59 → 1.3.60
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.
|
@@ -7,6 +7,13 @@ import { resolver_map_single } from "./v-map-utility";
|
|
|
7
7
|
*/
|
|
8
8
|
export function resolver_array_single(element, index, data) {
|
|
9
9
|
//从根元素开始渲染
|
|
10
|
+
//渲染信息
|
|
11
|
+
if (element.hasAttribute("@for-message")) {
|
|
12
|
+
var data_index = element.getAttribute("@for-message");
|
|
13
|
+
element.removeAttribute("@for-message");
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
element.innerText = data[data_index];
|
|
16
|
+
}
|
|
10
17
|
//解析data
|
|
11
18
|
if (element.hasAttribute("@data")) {
|
|
12
19
|
element.removeAttribute("@data");
|
|
@@ -19,13 +26,6 @@ export function resolver_array_single(element, index, data) {
|
|
|
19
26
|
// @ts-ignore
|
|
20
27
|
element.innerText = index;
|
|
21
28
|
}
|
|
22
|
-
//渲染信息
|
|
23
|
-
if (element.hasAttribute("@for-message")) {
|
|
24
|
-
var data_index = element.getAttribute("@for-message");
|
|
25
|
-
element.removeAttribute("@for-message");
|
|
26
|
-
// @ts-ignore
|
|
27
|
-
element.innerText = data[data_index];
|
|
28
|
-
}
|
|
29
29
|
resolver_array_multi(element.children, index, data);
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
@@ -37,18 +37,6 @@ export function resolver_array_single(element, index, data) {
|
|
|
37
37
|
export function resolver_array_multi(elements, index, data) {
|
|
38
38
|
//渲染模板子元素
|
|
39
39
|
for (var i = 0; i < elements.length; i++) {
|
|
40
|
-
//解析data
|
|
41
|
-
if (elements[i].hasAttribute("@data")) {
|
|
42
|
-
elements[i].removeAttribute("@data");
|
|
43
|
-
// @ts-ignore
|
|
44
|
-
elements[i].innerText = data;
|
|
45
|
-
}
|
|
46
|
-
//解析index
|
|
47
|
-
if (elements[i].hasAttribute("@index")) {
|
|
48
|
-
elements[i].removeAttribute("@index");
|
|
49
|
-
// @ts-ignore
|
|
50
|
-
elements[i].innerText = index;
|
|
51
|
-
}
|
|
52
40
|
//渲染文档
|
|
53
41
|
if (elements[i].hasAttribute("@for-document")) {
|
|
54
42
|
elements[i].removeAttribute("@for-document");
|
|
@@ -61,6 +49,18 @@ export function resolver_array_multi(elements, index, data) {
|
|
|
61
49
|
// @ts-ignore
|
|
62
50
|
elements[i].innerText = data[data_index];
|
|
63
51
|
}
|
|
52
|
+
//解析data
|
|
53
|
+
if (elements[i].hasAttribute("@data")) {
|
|
54
|
+
elements[i].removeAttribute("@data");
|
|
55
|
+
// @ts-ignore
|
|
56
|
+
elements[i].innerText = data;
|
|
57
|
+
}
|
|
58
|
+
//解析index
|
|
59
|
+
if (elements[i].hasAttribute("@index")) {
|
|
60
|
+
elements[i].removeAttribute("@index");
|
|
61
|
+
// @ts-ignore
|
|
62
|
+
elements[i].innerText = index;
|
|
63
|
+
}
|
|
64
64
|
resolver_array_multi(elements[i].children, index, data);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -5,6 +5,14 @@ import { extractForArray } from "./v-for";
|
|
|
5
5
|
* @param data
|
|
6
6
|
*/
|
|
7
7
|
export function resolver_map_single(element, data) {
|
|
8
|
+
if (element.hasAttribute("@map-document")) {
|
|
9
|
+
//检查v-for-item
|
|
10
|
+
if (element.hasAttribute("@map-document")) {
|
|
11
|
+
var property = element.getAttribute("@map-document");
|
|
12
|
+
element.removeAttribute("@map-document");
|
|
13
|
+
resolver_map_single(element, data[property]);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
8
16
|
//检查v-data
|
|
9
17
|
if (element.hasAttribute("@section")) {
|
|
10
18
|
var property = element.getAttribute("@section");
|
|
@@ -22,13 +30,6 @@ export function resolver_map_single(element, data) {
|
|
|
22
30
|
*/
|
|
23
31
|
export function resolver_map_multi(elements, data) {
|
|
24
32
|
var _loop_1 = function (i) {
|
|
25
|
-
//检查v-key
|
|
26
|
-
if (elements[i].hasAttribute("@section")) {
|
|
27
|
-
var property = elements[i].getAttribute("@section");
|
|
28
|
-
elements[i].removeAttribute("@section");
|
|
29
|
-
// @ts-ignore
|
|
30
|
-
elements[i].innerText = data[property];
|
|
31
|
-
}
|
|
32
33
|
if (elements[i].hasAttribute("@map-document")) {
|
|
33
34
|
//检查v-for-item
|
|
34
35
|
if (elements[i].hasAttribute("@map-document")) {
|
|
@@ -51,6 +52,13 @@ export function resolver_map_multi(elements, data) {
|
|
|
51
52
|
i--;
|
|
52
53
|
}
|
|
53
54
|
}
|
|
55
|
+
//检查v-key
|
|
56
|
+
if (elements[i].hasAttribute("@section")) {
|
|
57
|
+
var property = elements[i].getAttribute("@section");
|
|
58
|
+
elements[i].removeAttribute("@section");
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
elements[i].innerText = data[property];
|
|
61
|
+
}
|
|
54
62
|
//深度展开
|
|
55
63
|
if (elements[i]) {
|
|
56
64
|
resolver_map_multi(elements[i].children, data);
|