forked from RubyLouvre/avalon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrepeat17.html
60 lines (57 loc) · 2.43 KB
/
repeat17.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
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>ms-class</title>
<style type="text/css">
.hover{background-color: red;}
</style>
<script type="text/javascript" src="../avalon.repeat.js"></script>
<script>
var model = avalon.define('test', function(vm) {
vm.data = {A: [
{text: "title1", value: 111111},
{text: "title2", value: 222222},
{text: "title3", value: 333333}
], B: [
{text: "title1", value: 111111},
{text: "title2", value: 222222},
{text: "title3", value: 333333}
]};
vm.changeData1 = function() {
vm.data = {C: [
{text: "changeData1", value: 111111},
{text: "changeData2", value: 222222},
{text: "changeData3", value: 333333}
], D: [
{text: "changeData4", value: 111111},
{text: "changeData5", value: 222222},
{text: "changeData6", value: 333333}
]};
};
vm.changeData2 = function() {
vm.data = {E: [
{text: "changeData11", value: 111111},
{text: "changeData22", value: 222222},
{text: "changeData33", value: 333333}
], F: [
{text: "changeData44", value: 111111},
{text: "changeData55", value: 222222},
{text: "changeData66", value: 333333}
]};
};
});
</script>
</head>
<body>
<h3>修正ms-with下面存在ms-repeat时出错的BUG</h3>
<p><a href="https://github.com/RubyLouvre/avalon/issues/545">https://github.com/RubyLouvre/avalon/issues/545</a></p>
<div ms-controller="test">
<button ms-click="changeData1()">changeData1</button>
<button ms-click="changeData2()">changeData2</button>
<dl ms-with="data" id="aaa"><dt>{{$key}}</dt>
<dd ms-repeat="$val">{{el.text}} : {{el.value}}</dd>
</dl>
</div>
</body>
</html>