forked from RubyLouvre/avalon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex22with.html
69 lines (65 loc) · 1.7 KB
/
index22with.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
65
66
67
68
69
<!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;
}
</style>
<script >
var model = avalon.define('test', function(vm) {
vm.first = {
a: 1,
b: 1,
c: 1,
d: 1
}
});
setTimeout(function() {
console.log("测试修改")
model.first = {
a: 3,
b: 3,
c: 3,
d: 3
}
}, 1000)
setTimeout(function() {
console.log("测试移除")
model.first = {
a: 3,
b: 3
}
}, 2000)
setTimeout(function() {
console.log("测试添加")
model.first = {
a: 3,
b: 3,
f: 4,
g: 4
}
}, 3000)
setTimeout(function() {
console.log("测试排序")
model.first = {
g: 4,
f: 4,
b: 3,
a: 3
}
}, 4000)
</script>
</head>
<body >
<div ms-controller="test" ms-with="first">
<h1>{{$key}}-------------------{{$val}}</h1>
</div>
</body>
</html>