button.vue
7.93 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<template>
<h4>基本</h4>
<br><br>
<i-button type="success">按钮</i-button>
<i-button type="warning">按钮</i-button>
<i-button type="error">按钮</i-button>
<i-button type="info">按钮</i-button>
<i-button icon="ios-search" type="success"></i-button>
<br><br>
<div style="width:400px">
<i-button type="error" long size="small">按钮</i-button>
</div>
<br><br>
<Button-group>
<i-button>取消</i-button>
<i-button type="primary">确定</i-button>
</Button-group>
<Button-group>
<i-button disabled>昨日</i-button>
<i-button disabled>今日</i-button>
<i-button disabled>明日</i-button>
</Button-group>
<Button-group>
<i-button type="primary">L</i-button>
<i-button>M</i-button>
<i-button type="ghost">M</i-button>
<i-button type="dashed">R</i-button>
</Button-group>
<br><br>
<h4>配合图标</h4>
<br><br>
<Button-group>
<i-button type="primary">
<Icon type="chevron-left"></Icon>
前进
</i-button>
<i-button type="primary">
后退
<Icon type="chevron-right"></Icon>
</i-button>
</Button-group>
<Button-group>
<i-button type="primary" icon="ios-skipbackward"></i-button>
<i-button type="primary" icon="ios-skipforward"></i-button>
</Button-group>
<Button-group>
<i-button type="ghost" icon="ios-color-wand-outline"></i-button>
<i-button type="ghost" icon="ios-sunny-outline"></i-button>
<i-button type="ghost" icon="ios-crop"></i-button>
<i-button type="ghost" icon="ios-color-filter-outline"></i-button>
</Button-group>
<br><br>
<h4>圆角</h4>
<br><br>
<Button-group shape="circle">
<i-button type="primary">
<Icon type="chevron-left"></Icon>
前进
</i-button>
<i-button type="primary">
后退
<Icon type="chevron-right"></Icon>
</i-button>
</Button-group>
<Button-group shape="circle">
<i-button type="primary" icon="ios-skipbackward"></i-button>
<i-button type="primary" icon="ios-skipforward"></i-button>
</Button-group>
<Button-group shape="circle">
<i-button type="ghost" icon="ios-color-wand-outline"></i-button>
<i-button type="ghost" icon="ios-sunny-outline"></i-button>
<i-button type="ghost" icon="ios-crop"></i-button>
<i-button type="ghost" icon="ios-color-filter-outline"></i-button>
</Button-group>
<Button-group shape="circle" size="large">
<i-button type="primary" icon="ios-skipbackward"></i-button>
<i-button type="primary" icon="ios-skipforward"></i-button>
</Button-group>
<Button-group shape="circle" size="large">
<i-button type="ghost" icon="ios-color-wand-outline"></i-button>
<i-button type="ghost" icon="ios-sunny-outline"></i-button>
<i-button type="ghost" icon="ios-crop"></i-button>
<i-button type="ghost" icon="ios-color-filter-outline"></i-button>
</Button-group>
<Button-group shape="circle" size="small">
<i-button type="primary" icon="ios-skipbackward"></i-button>
<i-button type="primary" icon="ios-skipforward"></i-button>
</Button-group>
<Button-group shape="circle" size="small">
<i-button type="ghost" icon="ios-color-wand-outline"></i-button>
<i-button type="ghost" icon="ios-sunny-outline"></i-button>
<i-button type="ghost" icon="ios-crop"></i-button>
<i-button type="ghost" icon="ios-color-filter-outline"></i-button>
</Button-group>
<br><br>
<i-button type="primary" icon="ios-search" shape="circle" size="small"></i-button>
<i-button type="primary" icon="ios-search" shape="circle"></i-button>
<i-button type="primary" icon="ios-search" shape="circle" size="large"></i-button>
<i-button type="primary" icon="ios-search" shape="circle" size="small">搜索</i-button>
<i-button type="primary" icon="ios-search" shape="circle">搜索</i-button>
<i-button type="primary" icon="ios-search" shape="circle" size="large">搜索</i-button>
<br><br>
<i-button>Default</i-button>
<i-button type="primary">Primary</i-button>
<i-button type="ghost">Ghost</i-button>
<i-button type="dashed">Dashed</i-button>
<i-button type="text">文字按钮</i-button>
<i-button type="text" disabled>文字按钮</i-button>
<br><br>
<i-button type="primary" size="large">Large</i-button>
<i-button type="primary">Default</i-button>
<i-button type="primary" size="small">Small</i-button>
<br><br>
<i-button>Default</i-button>
<i-button disabled>Default(Disabled)</i-button>
<br><br>
<i-button type="primary">Primary</i-button>
<i-button type="primary" disabled>Primary(Disabled)</i-button>
<br><br>
<i-button type="ghost">Ghost</i-button>
<i-button type="ghost" disabled>Ghost(Disabled)</i-button>
<br><br>
<i-button type="dashed">dashed</i-button>
<i-button type="dashed" disabled>dashed(Disabled)</i-button>
<br><br>
<i-button type="primary" shape="circle" icon="ios-search"></i-button>
<i-button type="primary" icon="ios-search">搜索</i-button>
<br><br>
<i-button type="ghost" shape="circle">
<Icon type="search"></Icon>
</i-button>
<i-button type="ghost">
<Icon type="search"></Icon>
搜索
</i-button>
<i-button type="ghost" shape="circle" size="large">
<Icon type="search"></Icon>
</i-button>
<i-button type="ghost" shape="circle" size="small">
<Icon type="search"></Icon>
</i-button>
<br><br><br>
<i-button type="primary" loading>Loading...</i-button>
<i-button type="primary" loading size="large">Loading...</i-button>
<i-button type="primary" loading size="small">Loading...</i-button>
<i-button type="primary" :loading="loading" @click="toLoading">
<span v-if="!loading">Click me!</span>
<span v-else>Loading...</span>
</i-button>
<i-button type="primary" :loading="loading2" icon="checkmark-round" @click="toLoading2">
<span v-if="!loading2">Click me!</span>
<span v-else>Loading...</span>
</i-button>
<h4>基本</h4>
<Button-group size="large">
<i-button>取消</i-button>
<i-button type="primary">确定</i-button>
</Button-group>
<Button-group>
<i-button type="primary">L</i-button>
<i-button>M</i-button>
<i-button type="ghost">R</i-button>
<i-button type="dashed">R</i-button>
</Button-group>
<h4>配合图标</h4>
<Button-group>
<i-button type="primary">
<Icon type="chevron-left"></Icon>
前进
</i-button>
<i-button type="primary">
后退
<Icon type="chevron-right"></Icon>
</i-button>
</Button-group>
<Button-group>
<i-button type="primary" icon="cloud"></i-button>
<i-button type="primary" icon="upload"></i-button>
</Button-group>
</template>
<script>
import { iButton, Icon, Input, Switch, Radio, Checkbox, InputNumber, Row, Col, Page } from 'iview';
const ButtonGroup = iButton.Group;
const RadioGroup = Radio.Group;
const CheckboxGroup = Checkbox.Group;
export default {
components: {
iButton,
ButtonGroup,
Icon,
iInput: Input,
Switch,
Radio,
RadioGroup,
Checkbox,
CheckboxGroup,
InputNumber,
Row,
iCol: Col,
Page
},
props: {
},
data () {
return {
loading: false,
loading2: false,
model6: ''
}
},
methods: {
toLoading () {
this.loading = true;
},
toLoading2 () {
this.loading2 = true;
}
}
}
</script>