跳到主要内容
版本:v7

ion-progress-bar

shadow

进度条用于告知用户进行中任务的状态,例如应用加载、表单提交或保存更新。进度条有两种类型:determinate(确定型)和 indeterminate(不确定型)。

确定型进度条

确定型是默认类型。当操作进度百分比已知时应使用此类型。通过设置 value 属性来显示进度,可用于展示从轨道 0% 到 100% 的进度增长过程。

缓冲状态

若设置了 buffer 属性,将显示带有动画圆点的缓冲流以指示活动状态。buffer 属性的值也会通过可见轨道的长度来体现。如果 buffer 的值小于 value 属性,则不会显示可见轨道。若 buffer 等于 1,缓冲流将被隐藏。

不确定型进度条

不确定型应用于无法预估任务所需时间的情况。该进度条不与 value 值绑定,而是在任务完成前持续在轨道上滑动。

工具栏中的进度条

主题定制

颜色

CSS 自定义属性

CSS Shadow Parts

属性

buffer

DescriptionIf the buffer and value are smaller than 1, the buffer circles will show. The buffer should be between [0, 1].
Attributebuffer
Typenumber
Default1

color

DescriptionThe color to use from your application's color palette. Default options are: "primary", "secondary", "tertiary", "success", "warning", "danger", "light", "medium", and "dark". For more information on colors, see theming.
Attributecolor
Type"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string | undefined
Defaultundefined

mode

DescriptionThe mode determines which platform styles to use.

This is a virtual property that is set once during initialization and will not update if you change its value after the initial render.
Attributemode
Type"ios" | "md"
Defaultundefined

reversed

DescriptionIf true, reverse the progress bar direction.
Attributereversed
Typeboolean
Defaultfalse

type

DescriptionThe state of the progress bar, based on if the time the process takes is known or not. Default options are: "determinate" (no animation), "indeterminate" (animate from left to right).
Attributetype
Type"determinate" | "indeterminate"
Default'determinate'

value

DescriptionThe value determines how much of the active bar should display when the type is "determinate". The value should be between [0, 1].
Attributevalue
Typenumber
Default0

事件

No events available for this component.

方法

No public methods available for this component.

CSS Shadow Parts

NameDescription
progressThe progress bar that shows the current value when type is "determinate" and slides back and forth when type is "indeterminate".
streamThe animated circles that appear while buffering. This only shows when buffer is set and type is "determinate".
trackThe track bar behind the progress bar. If the buffer property is set and type is "determinate" the track will be the width of the buffer value.

CSS 自定义属性

NameDescription
--backgroundBackground of the progress track, or the buffer bar if buffer is set
--buffer-backgroundDEPRECATED, use --background instead
--progress-backgroundBackground of the progress bar representing the current value

插槽

No slots available for this component.