Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/markdown/en/progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,24 @@ Click the buttons below to see the transition of progress.
```
:::

## Indeterminate

Progress bar has an indeterminate state, that animates forever.

:::demo
```html
<at-progress indeterminate></at-progress>
```
:::

## Progress Props

| Property | Description | Type | Accepted Values | Default |
|---------- |-------------- |---------- |-------------------------------- |-------- |
| percent | the percentage of Progress | Number | - | 0 |
| status | the status of Progress | String | `success`, `error` | - |
| stroke-width | the width of Progress Bar | Number | - | 8 |
| indeterminate | the width of Progress Bar | Boolean | `true`, `false` | `false` |

## Progress Events

Expand Down
17 changes: 13 additions & 4 deletions src/components/progress/src/progress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@

<!-- S 条状进度条 -->
<div class="at-progress-bar" v-else>
<div class="at-progress-bar__wraper" :style="barStyle">
<div class="at-progress-bar__inner" :style="{ width: percent + '%' }"></div>
<div class="at-progress-bar__wraper" :class="{'at-progress--indeterminate': indeterminate} "
:style="barStyle">
<div class="at-progress-bar__inner" :style="[{ width: percent + '%' }]"></div>
</div>
</div>
<div class="at-progress__text">
<div class="at-progress__text" v-if="!indeterminate">
<span v-if="!currentStatus">{{ percent }}%</span>
<i v-else class="icon" :class="statusIconClass"></i>
</div>
Expand All @@ -40,12 +41,15 @@ export default {
percent: {
type: Number,
default: 0,
required: true,
validator: val => val >= 0 && val <= 100
},
strokeWidth: {
type: Number,
default: 8
},
indeterminate: {
type: Boolean,
default: false
}
},
data () {
Expand All @@ -61,6 +65,11 @@ export default {
},
statusIconClass () {
return this.currentStatus === 'success' ? 'icon-check-circle' : 'icon-x-circle'
},
progresStyle () {
return {
width: `${this.percent}%`
}
}
},
watch: {
Expand Down