forked from RubyLouvre/avalon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index23with.html
64 lines (57 loc) · 1.52 KB
/
index23with.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
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html>
<head>
<title>ms-with</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="avalon.js"></script>
<style>
.red{
color:red;
}
.green{
color:greenyellow;
}
.aaa{
color:green;
}
</style>
<script >
var model = avalon.define("test", function(vm) {
vm.items = {
aaa: 1,
bbb: 2,
ccc: 3,
ddd: 4,
eee: 5
}
})
setTimeout(function() {
console.log("==================")
model.items = {
ccc: 2,
aaa: 1,
eee: 6,
bbb: 3,
ddd: 4
}
}, 2000)
</script>
</head>
<body >
<div ms-controller="test">
<div ms-with="items">
<p>{{$key}}-------------------{{$val}}</p>
<ul ms-with="$val">
<li>{{$key}} {{$val}}</li>
</ul>
</div>
<hr />
<div ms-with="items">
<p>{{$key}}-------------------{{$val}}</p>
<ul ms-with="$val">
<li>{{$key}} {{$val}}</li>
</ul>
</div>
</div>
</body>
</html>