-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.html
54 lines (51 loc) · 1.52 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script src="xcube.js"></script>
<style>
li{
margin:20px;
}
</style>
</head>
<body>
<div xc-controller="Ctrl">
<div>{{a.val}}+{{a.b}}*2={{b.val+b.c*2+' xxxx'|html|caps}}--{{abc}}</div>
{{abc}}
<div>{{cc}}</div>
<div xc-debug-1>{{a.c}}</div>
<ul>
<li id="abc" xc-repeat="el in a.list">
<div>{{el.abc}}</div>
<div xc-repeat="key:val in el.list2" >{{key}},{{$index}},{{val|json}}{{$first}}</div>
<div>{{el.list2|json}}</div>
<div xc-repeat="key:val in el.list2" xc-debug-2><span>{{key}},{{val.d}},{{$last}}</span></div>
<div>{{el.x.b}}</div>
</li>
<li class="last">end</li>
</ul>
<ul>
<li xc-repeat="el in set">
<div xc-repeat="e in el">{{e}}</div>
</li>
<li xc-repeat="el in set2">
<div>{{el}}</div><!-- e -->
</li>
</ul>
<div xc-controller="child">{{xx}}</div>
</div>
</body>
<script>
document.addEventListener("DOMContentLoaded", function () {
console.log('===================================');
_viewModels.Ctrl.a.list=[{list2:[{d:1},{d:2},{d:3}],x:{b:2},abc:'a',middle:{b:1}},{list2:{a:{d:11},b:{d:22},c:{d:33}},x:{b:22},abc:'b',middle:{b:1}}];
//Ctrl.a.list[0].list2={a:1,b:2,c:3};
/* console.log('===================================');
*/
//_viewModels.Ctrl.list=[{list2:[2],abc:2,x:{b:4}},{list2:[3,4],abc:5,x:{b:6}}]
//_viewModels.Ctrl.set=[[1,2,3],[4,5,6]];
}, false);
</script>
</html>