forked from RubyLouvre/mass-Framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
array.html
36 lines (29 loc) · 919 Bytes
/
array.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
<!DOCTYPE HTML>
<html>
<head>
<title>array by 司徒正美</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="mass.js"></script>
</head>
<body>
<script>
$.require("ready,./more/avalon2", function(){
var model = $.ViewModel({
array: [1,2,3,4]
});
$.View(model);
// setTimeout(function(){
// model.array.push(1,3)
// },1000)
//要求页面输出a,b,c,d,1,2,3,4
setTimeout(function(){
model.array.unshift("a","b","c","d")
$.log(model.array.length)
},1000);
})
</script>
<ul bind="foreach: array" >
<li bind="text:$value"></li>
</ul>
</body>
</html>