forked from RubyLouvre/avalon.oniui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathavalon.miniswitch.ex4.html
96 lines (96 loc) · 3.89 KB
/
avalon.miniswitch.ex4.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<html>
<head>
<title></title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<link type="text/css" rel="stylesheet" href="../style/avalon.doc.css"/>
<script src="../avalon.js"></script>
<script src="../highlight/shCore.js"></script>
<script type="text/javascript">
require(['miniswitch/avalon.miniswitch.js'], function() {
avalon.ready(function() {
//multiple select vmodel
avalon.define('miniswitch', function(vm) {
vm.$opts = {
switchOpt: [{
value: 1,
label : ' 配置启用',
cls: 'g-icon-start',
title: '启用',
font: ''
},
{
value: 2,
label : ' 配置暂停',
cls: 'g-icon-pause',
title: '暂停',
font: ''
}],
value: 2
};
vm.d = 1;
});
avalon.scan();
});
});
</script>
</head>
<body>
<div class="wrapper">
<div ms-controller="miniswitch">
<h2>图标式下拉开关(miniswitch)</h2>
<p>用options配置组件并设置duplex</p>
<select ms-widget="miniswitch,$,$opts" ms-duplex="d"></select>
<p>select:{{d}}</p>
</div>
<pre class="brush:html;gutter:false;toolbar:false;" ms-skip>
<html>
<head>
<title></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>
<script type="text/javascript">
require('miniswitch/avalon.miniswitch.js', function() {
avalon.ready(function() {
//multiple select vmodel
avalon.define('miniswitch', function(vm) {
vm.$opts = {
switchOpt: [{
value: 1,
label : ' 配置启用',
cls: 'g-icon-start',
title: '启用',
font: '&#xf111;'
},
{
value: 2,
label : ' 配置暂停',
cls: 'g-icon-pause',
title: '暂停',
font: '&#xf04c;'
}],
value: 2
};
vm.d = 1;
});
avalon.scan();
});
});
</script>
</head>
<body>
<div class="wrapper">
<div ms-controller="miniswitch">
<h2>图标式下拉开关(miniswitch)</h2>
<p>用options配置组件并设置duplex</p>
<select ms-widget="miniswitch,$,$opts" ms-duplex="d"></select>
<p>select:{{d}}</p>
</div>
</div>
</body>
</html>
</pre>
</div>
</body>
</html>