forked from RubyLouvre/avalon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinclude3.html
56 lines (54 loc) · 1.9 KB
/
include3.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ms-include、 html filter and scanCallback</title>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<script src="../avalon.js"></script>
<style>
.bp{
border: 1px solid green;
}
.contain{
border: 1px solid red;
}
</style>
<script>
var vmodel = avalon.define({
$id: "test",
title: "测试scanCallback",
a: 3,
temp: "aaa",
repeatcb: function(a){
console.log(a)
},
array: [1,2,3,4,5,6],
render: function(){
console.log(this.innerHTML)
},
click: function() {
vmodel.array.push(new Date -0 )
//vmodel.temp = vmodel.temp === "aaa" ? "bbb" : "aaa"
},
b: '<p><a href="avalon.validation.ex3.html">自带验证规则maxlength,minlength,lt,gt,eq,equal</a></p>'
})
</script>
<script id="aaa" type="avalon">
xxxxxxxxxxxxx
</script>
<script id="bbb" type="avalon">
{{b|html}}
</script>
</head>
<body ms-controller="test">
<h1>{{title}}</h1>
<div>{{b|html }}</div>
<div ms-include="temp" data-include-rendered="render" ></div>
<div ms-visible="a">{{title}}</div>
<button type="button" ms-click="click">change temp</button>
<div ms-repeat="array" data-repeat-rendered="repeatcb">{{el}}</div>
<select ms-duplex="a">
<option ms-repeat="array">{{el}}</option>
</select>
</body>
</html>