Repository navigation
Expand file tree
/
Copy pathactions.html
More file actions
96 lines (96 loc) · 2.73 KB
/
Copy pathactions.html
File metadata and controls
96 lines (96 loc) · 2.73 KB
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
<article class="component" id='actions'>
<h2 class="component-title">操作表</h2>
<p class="component-description">操作表可以让用户从多个可选的操作中选择一个</p>
<p class="component-description"><code>$.actions(buttons)</code> - 创建并弹出一个操作表</p>
<ul>
<li><code>buttons</code> - 显示的几个按钮,你也可以把按钮分组</li>
</ul>
<p>你可以通过 <code>color: "danger"</code> 来指定按钮的文案为红色</p>
<p>或者通过 <code>bg: "danger"</code> 来指定按钮的背景为红色</p>
<div class="component-example component-example-fullbleed">
<header class="bar bar-nav">
<h1 class="title">操作表</h1>
</header>
<div class="content">
<div class="content-block">
<!-- In data-popup attribute we specify CSS selector of popup we need to open -->
<p><a href="#" class="create-actions">选择操作</a></p>
</div>
</div>
<script>
$(document).on('click','.create-actions', function () {
var buttons1 = [
{
text: '请选择',
label: true
},
{
text: '卖出',
bold: true,
color: 'danger',
onClick: function() {
$.alert("你选择了“卖出“");
}
},
{
text: '买入',
onClick: function() {
$.alert("你选择了“买入“");
}
}
];
var buttons2 = [
{
text: '取消',
bg: 'danger'
}
];
var groups = [buttons1, buttons2];
$.actions(groups);
});
</script>
</div>
{% highlight html %}
<header class="bar bar-nav">
<h1 class="title">操作表</h1>
</header>
<div class="content">
<div class="content-block">
<!-- In data-popup attribute we specify CSS selector of popup we need to open -->
<p><a href="#" class="create-actions">选择操作</a></p>
</div>
</div>
{% endhighlight %}
{% highlight js %}
$(document).on('click','.create-actions', function () {
var buttons1 = [
{
text: '请选择',
label: true
},
{
text: '卖出',
bold: true,
color: 'danger',
onClick: function() {
$.alert("你选择了“卖出“");
}
},
{
text: '买入',
onClick: function() {
$.alert("你选择了“买入“");
}
}
];
var buttons2 = [
{
text: '取消',
bg: 'danger'
}
];
var groups = [buttons1, buttons2];
$.actions(groups);
});
{% endhighlight %}
</article>