forked from RubyLouvre/avalon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test1.html
44 lines (41 loc) · 1.41 KB
/
test1.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
<!DOCTYPE html>
<html>
<head>
<title>avalon入门</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="avalon.js" type="text/javascript"></script>
<script>
var model = avalon.define("test", function(vm) {
vm.data = {items: []};
vm.elements = ['items', "ddd"];
});
</script>
</head>
<body>
<!-- <div ms-if="data[el].length===0">
no number
</div>
<div ms-repeat-number="data[el]">
{{number}}
</div>-->
<div id="main">
<div ms-controller="test" >
<div ms-repeat="elements">
<div ms-if="data[el].length===0">
no number
</div>
<div ms-repeat-number="data[el]">
{{number}}
</div>
</div>
</div>
</div>
<script>
var cache = document.getElementById('main').innerHTML;
setInterval(function() {
document.getElementById('main').innerHTML = cache.replace(/bigpic\.jpg/, "bigpic.jpg?" + Date.now());
avalon.scan();
}, 500);
</script>
</body>
</html>