-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathms-repeat.html
37 lines (33 loc) · 1.01 KB
/
ms-repeat.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
<!DOCTYPE html>
<html>
<head>
<title>虚拟DOM测试</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="avalon.js"></script>
<script>
var vm = avalon.define({
$id: "test",
array: ["a", "b", "c", "d"]
})
setTimeout(function () {
// vm.array.pop()
// vm.array.shift()
// vm.array.set(0, "1")
// vm.array.set(1, "11")
// vm.array.set(2, "111")
// vm.array.set(3, "222")
// vm.array = ["1","2","c","d","22"]
vm.array.reverse()
// vm.array.push(5, 6)
// vm.array.splice(0,3)
}, 3000)
</script>
</head>
<body ms-controller="test">
<h1>测试虚拟DOM</h1>
<ul>
<li ms-repeat="array">{{el}}*{{$index}}</li>
</ul>
</body>
</html>