forked from RubyLouvre/avalon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathif2.html
32 lines (31 loc) · 966 Bytes
/
if2.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
<!DOCTYPE HTML>
<html>
<head>
<title>ms-if</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script src="../avalon.js" ></script>
<style>
.active{
background: blueviolet;
}
</style>
<script>
avalon.define('xxx', function(vm) {
vm.data = {
toggle: true
}
vm.toggle = function() {
vm.data.toggle = !vm.data.toggle
}
});
</script>
</head>
<body>
<div class="avalonHide">测试avalonHide</div>
<div ms-controller="xxx">
<div ms-if="data.toggle" class="active">能动态添加移除</div>{{data.toggle}}
<p><button type='button' ms-click='toggle'>点我</button></p>
</div>
</body>
</html>