progress.vue
998 Bytes
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
<template>
<div>
<Progress :percent="percent"></Progress>
<Button-group size="large">
<Button icon="ios-plus-empty" @click.native="add"></Button>
<Button icon="ios-minus-empty" @click.native="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>
export default {
data () {
return {
percent: 0
}
},
methods: {
add () {
if (this.percent >= 100) {
return false;
}
this.percent += 10;
},
minus () {
if (this.percent <= 0) {
return false;
}
this.percent -= 10;
}
}
}
</script>