render-core 1.3.53 → 1.3.55
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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolver_map_single } from "./v-map-utility";
|
|
2
2
|
/**
|
|
3
3
|
* 遍历根元素
|
|
4
4
|
* @param element
|
|
@@ -35,7 +35,8 @@ export function resolver_array_single(element, index, data) {
|
|
|
35
35
|
* @param data
|
|
36
36
|
*/
|
|
37
37
|
export function resolver_array_multi(elements, index, data) {
|
|
38
|
-
|
|
38
|
+
//渲染模板子元素
|
|
39
|
+
for (var i = 0; i < elements.length; i++) {
|
|
39
40
|
//解析data
|
|
40
41
|
if (elements[i].hasAttribute("@data")) {
|
|
41
42
|
elements[i].removeAttribute("@data");
|
|
@@ -49,22 +50,9 @@ export function resolver_array_multi(elements, index, data) {
|
|
|
49
50
|
elements[i].innerText = index;
|
|
50
51
|
}
|
|
51
52
|
//渲染文档
|
|
52
|
-
if (elements[i].hasAttribute("for-document")) {
|
|
53
|
+
if (elements[i].hasAttribute("@for-document")) {
|
|
53
54
|
elements[i].removeAttribute("@for-document");
|
|
54
|
-
|
|
55
|
-
data.forEach(function (value) {
|
|
56
|
-
//从数组中取出一条信息,然后开始渲染
|
|
57
|
-
extractForMap(elements[i].parentNode, elements[i], value);
|
|
58
|
-
i++;
|
|
59
|
-
});
|
|
60
|
-
//将模板节点删除
|
|
61
|
-
elements[i].parentNode.removeChild(elements[i]);
|
|
62
|
-
//重新回到原来的索引值
|
|
63
|
-
i--;
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
console.log("Instruction @list need an array datatype to extract!");
|
|
67
|
-
}
|
|
55
|
+
resolver_map_single(elements[i], data);
|
|
68
56
|
}
|
|
69
57
|
//渲染信息
|
|
70
58
|
if (elements[i].hasAttribute("@for-message")) {
|
|
@@ -74,12 +62,5 @@ export function resolver_array_multi(elements, index, data) {
|
|
|
74
62
|
elements[i].innerText = data[data_index];
|
|
75
63
|
}
|
|
76
64
|
resolver_array_multi(elements[i].children, index, data);
|
|
77
|
-
out_i_1 = i;
|
|
78
|
-
};
|
|
79
|
-
var out_i_1;
|
|
80
|
-
//渲染模板子元素
|
|
81
|
-
for (var i = 0; i < elements.length; i++) {
|
|
82
|
-
_loop_1(i);
|
|
83
|
-
i = out_i_1;
|
|
84
65
|
}
|
|
85
66
|
}
|