mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-05 05:29:01 +08:00
49 lines
858 B
Markdown
49 lines
858 B
Markdown
|
<cn>
|
||
|
#### 进度圈动态展示
|
||
|
会动的进度条才是好进度条。
|
||
|
</cn>
|
||
|
|
||
|
<us>
|
||
|
#### Dynamic circular progress bar
|
||
|
A dynamic progress bar is better.
|
||
|
</us>
|
||
|
|
||
|
```html
|
||
|
<template>
|
||
|
<div>
|
||
|
<a-progress type="circle" :percent="percent" />
|
||
|
<a-button-group>
|
||
|
<a-button @click="decline" icon="minus" />
|
||
|
<a-button @click="increase" icon="plus" />
|
||
|
</a-button-group>
|
||
|
</div>
|
||
|
</template>
|
||
|
<script>
|
||
|
export default {
|
||
|
data () {
|
||
|
return {
|
||
|
percent: 0,
|
||
|
}
|
||
|
},
|
||
|
methods: {
|
||
|
increase() {
|
||
|
let percent = this.percent + 10;
|
||
|
if (percent > 100) {
|
||
|
percent = 100;
|
||
|
}
|
||
|
this.percent = percent
|
||
|
},
|
||
|
decline() {
|
||
|
let percent = this.percent - 10;
|
||
|
if (percent < 0) {
|
||
|
percent = 0;
|
||
|
}
|
||
|
this.percent = percent
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
</script>
|
||
|
```
|
||
|
|
||
|
|