May 07, 2021 Vant
import Vue from 'vue';
import { Progress } from 'vant';
Vue.use(Progress);
The progress bar is blue by default, using the percentage property to set the current progress
<van-progress :percentage="50" />
The weight of the progress bar can be set bystroke-width
<van-progress :percentage="50" stroke-width="8" />
When the active property is set, the progress bar is grayed out
<van-progress inactive :percentage="50" />
You can customize the text using the pivot-text property and the color property to customize the progress bar color
<van-progress
pivot-text="橙色"
color="#f2826a"
:percentage="25"
/>
<van-progress
pivot-text="红色"
color="#ee0a24"
:percentage="50"
/>
<van-progress
:percentage="75"
pivot-text="紫色"
pivot-color="#7232dd"
color="linear-gradient(to right, #be99ff, #7232dd)"
/>
Parameters | Description | Type | The default |
---|---|---|---|
percentage | The percentage of progress | number | string |
0
|
stroke-width
v2.2.1
|
Progress bar weight, the default unit is
px
|
number | string |
4px
|
color | The color of the progress bar | string |
#1989fa
|
track-color
v2.2.9
|
Track color | string |
#e5e5e5
|
pivot-text | Progress text content | string | Percentage |
pivot-color | The background color of the progress text | string | Same progress bar color |
text-color | The color of the progress text | string |
white
|
inactive | Whether to put ash | boolean |
false
|
show-pivot | Whether to display the progress text | boolean |
true
|