forked from RubyLouvre/avalon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrepeat18.html
31 lines (29 loc) · 943 Bytes
/
repeat18.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
<!DOCTYPE html>
<html>
<head>
<title>取得光标的位置</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta http-equiv="X-UA-Compatible" content="IE=9" />
<script src="../avalon.js"></script>
<script>
avalon.define("xxx", function(vm) {
vm.array = []
vm.add = function() {
vm.array.push(1, 2, 3, 4)
}
vm.clear = function() {
vm.array.clear()
}
})
</script>
</head>
<body ms-controller="xxx">
<h2>确保新添加的元素都在ms-repeat-end注释节点之前</h2>
<ul ms-each="array" id="aaa">
<li>{{el}}</li>
</ul>
<button ms-click="add" type="button">xxx</button>
<button ms-click="clear" type="button">xxx</button>
</body>
</html>