button.vue
3.74 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
<style>
</style>
<template>
<Button size="small" shape="circle" type="primary" icon="add" @click="abc">
<Icon type="link"></Icon>
链接
</Button>
<Button-group>
<Button>上一页</Button>
<Button>1</Button>
<Button>2</Button>
<Button>3</Button>
<Button>下一页</Button>
</Button-group>
{{ msg }}
<i-input placeholder="请输入邮箱" size="large" :value.sync="msg" @keyup.enter="abc"></i-input>
<Switch size="large" @on-change="changeSwitch">
<span slot="checkedItem">开</span>
<span slot="unCheckedItem">关</span>
</Switch>
<br>
<Radio @on-change="changeRadio">梁灏</Radio>
<Radio checked>谦翔</Radio>
<br><br><br>
<Radio value="谦翔">
谦翔
</Radio>
<Radio value="梁灏">
梁灏
</Radio>
<Radio value="倪斌">
倪斌
</Radio>
<Radio value="段模">
段模
</Radio>
<br><br><br>
<Radio-group>
<Radio value="谦翔">
谦翔
</Radio>
<Radio value="梁灏">
梁灏
</Radio>
<Radio value="倪斌">
倪斌
</Radio>
<Radio value="段模">
段模
</Radio>
</Radio-group>
<br><br><br>
<Checkbox-group :model="checkbox" @on-change="groupChange">
<Checkbox value="梁灏">梁灏</Checkbox>
<Checkbox value="段模">段模</Checkbox>
<Checkbox value="倪斌">倪斌</Checkbox>
</Checkbox-group>
<br><br><br>
<div @click="changeCB">切换名称数据</div>
{{ checkbox | json }}
<br><br><br>
<Checkbox :checked.sync="singleRadio" @on-change="singleChange">梁灏</Checkbox>
<br>
{{ singleRadio }}
<div @click="singleRadio = !singleRadio">切换单个名称数据</div>
<br><br><br>
------------------------------
<Input-number :step="1.2" :value="1"></Input-number>
{{ inumber }}
<br><br><br>
<Row type="flex" align="top" justify="end" class="hello world">
<i-col span="8" offset="2" class="nihao shijie">1</i-col>
<i-col span="8" push="3">2</i-col>
<i-col span="8" order="2">3</i-col>
</Row>
<br><br><br>
<Page :current="1" :total="100" simple></Page>
</template>
<script>
import { Button, Icon, Input, Switch, Radio, Checkbox, InputNumber, Row, Col, Page } from 'iview';
const ButtonGroup = Button.Group;
const RadioGroup = Radio.Group;
const CheckboxGroup = Checkbox.Group;
export default {
components: {
Button,
ButtonGroup,
Icon,
iInput: Input,
Switch,
Radio,
RadioGroup,
Checkbox,
CheckboxGroup,
InputNumber,
Row,
iCol: Col,
Page
},
props: {
},
data () {
return {
msg: 123,
radio: '梁灏',
checkbox: ['倪斌'],
inumber: 5,
singleRadio: true
}
},
ready () {
setTimeout(() => {
// this.checkbox = ['倪斌', '梁灏'];
}, 2000);
},
methods: {
abc() {
console.log(123);
},
changeSwitch (data) {
console.log(data);
},
changeRadio (data) {
console.log(data);
},
changeCB () {
this.checkbox = ['梁灏', '段模'];
},
groupChange (data) {
// console.log(data);
},
singleChange (data) {
// console.log(data);
}
}
}
</script>