进度条 Progress bar

progress-bar 的 API

Angular Material progress-bar API 参考文档

import {MatProgressBarModule} from '@angular/material/progress-bar';

<mat-progress-bar> 组件

<mat-progress-bar> component.

选择器: mat-progress-bar
导出为: matProgressBar
属性
名称 描述
@Input()

bufferValue: number

进度条的缓冲值。默认为零。

Buffer value of the progress bar. Defaults to zero.

@Input()

color: ThemePalette

Theme color palette for the component.

@Input()

mode: ProgressBarMode

进度条的模式吧。

Mode of the progress bar.

此输入属性必须是以下值之一:determinate、indeterminate、buffer 和 query,默认为 'determinate'。会镜像到 mode 属性。

Input must be one of these values: determinate, indeterminate, buffer, query, defaults to 'determinate'. Mirrored to mode attribute.

@Input()

value: number

进度条的值。默认为零。镜像到 aria-valuenow。

Value of the progress bar. Defaults to zero. Mirrored to aria-valuenow.

@Output()

animationEnd: EventEmitter<ProgressAnimationEnd>

当主进度条的动画完成时会发出本事件。当禁用动画时,不会发出此事件,也不会为具有连续动画的模式(不定动画和查询动画)发出此事件。

Event emitted when animation of the primary progress bar completes. This event will not be emitted when animations are disabled, nor will it be emitted for modes with continuous animations (indeterminate and query).

defaultColor: ThemePalette | undefined

Default color to fall back to if no value is set.

progressbarId: `mat-progress-bar-${progressbarId++}`

进度条的 ID。

ID of the progress bar.

最后一个动画结束数据

Last animation end data.

属性
名称 描述

value: number

type ProgressBarMode = 'determinate' | 'indeterminate' | 'buffer' | 'query';

Angular Material progress-bar-testing API 参考文档

import {MatProgressBarHarness} from '@angular/material/progress-bar/testing';

在测试中用来与标准 mat-progress-bar 进行交互的测试工具。

Harness for interacting with a standard mat-progress-bar in tests.

方法
异步
getMode

Gets the progress bar's mode.

返回值

Returns

Promise<string | null>
异步
getValue

Gets the progress bar's value.

返回值

Returns

Promise<number | null>
异步
host

获取一个代表该组件宿主元素的 TestElementPromise

Gets a Promise for the TestElement representing the host element of the component.

返回值

Returns

Promise<TestElement>

A set of criteria that can be used to filter a list of MatProgressBarHarness instances.