跳到主要内容
版本:v8

进度条组件

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
--progress-backgroundBackground of the progress bar representing the current value

插槽

No slots available for this component.