tag.vue
2.21 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
<template>
<div>
<Button @click="start">start</Button>
<Button @click="destroy">destroy</Button>
<Button @click="finish">finish</Button>
<Button @click="error">error</Button>
<Button @click="update">update</Button>
<br><br>
<Progress :percent="25"></Progress>
<Progress :percent="45" status="success"></Progress>
<Progress :percent="45" status="active"></Progress>
<Progress :percent="65" status="wrong"></Progress>
<Progress :percent="100"></Progress>
<Progress :percent="25" hide-info></Progress>
<Progress :percent="percent"></Progress>
<Button-group size="large">
<Button icon="ios-plus-empty" @click="add"></Button>
<Button icon="ios-minus-empty" @click="minus"></Button>
</Button-group>
<Progress :percent="25" :stroke-width="5"></Progress>
<Progress :percent="100">
<Icon type="checkmark-circled"></Icon>
<span>成功</span>
</Progress>
</div>
</template>
<script>
import { Tag, LoadingBar, Button, Progress, Icon } from 'iview';
const ButtonGroup = Button.Group;
export default {
components: {
Tag,
Button,
Progress,
ButtonGroup,
Icon
},
props: {
},
data () {
return {
percent: 0
}
},
computed: {
},
methods: {
start () {
LoadingBar.start();
},
destroy () {
LoadingBar.destroy();
},
finish () {
LoadingBar.finish();
},
error () {
LoadingBar.error();
},
update () {
LoadingBar.update(50);
},
add () {
if (this.percent >= 100) {
return false;
}
this.percent += 10;
},
minus () {
if (this.percent <= 0) {
return false;
}
this.percent -= 10;
}
}
}
</script>