forked from RubyLouvre/avalon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index_repeat.html
49 lines (44 loc) · 1.7 KB
/
index_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
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE HTML>
<html id="html">
<head>
<meta charset="utf-8">
<title>充值例子</title>
<script src="avalon.js"></script>
</head>
<body>
<script>
window.console = {}
console.log = function(s) {
avalon.ready(function() {
var div = document.createElement("div")
document.body.appendChild(div)
div.innerHTML = s
})
}
var m = avalon.define('main', function(vm) {
vm.moneys = [50, 100, 200, 500, 1000, 2000, 5000, 10000]
vm.money = "100"
vm.other = ""
vm.toggle = true
});
setTimeout(function() {
m.money = "500"
}, 3000)
</script>
<h3>充值例子,演示ms-repeat与ms-duplex-text的使用</h3>
<div ms-controller="main">
<div>充值金额: </div>
<ul style="width: 800px;list-style: none;float: left;">
<li style="width:180px; float: left" ms-repeat="moneys">
<input type="radio" ms-value="el" ms-duplex-text="money" name="aaa">{{el}}元
</li>
<li style="width:780px; float: left">
<input type="radio" ms-value="other" ms-duplex-text="money" name="aaa">其他金额: <input ms-duplex="other">
</li>
</ul>
<br clear="both"/>
<p><input ms-duplex="toggle" type="radio"/>{{toggle}}</p>
<p><b style="color:orange">{{money}}人民币</b>,获得<b style="color:orange">{{money * 10}}</b>元宝</p>
</div>
</body>
</html>