网格列表 Grid list

grid-list 的 API

Angular Material grid-list API 参考文档

import {MatGridListModule} from '@angular/material/grid-list';

选择器: mat-grid-list
导出为: matGridList
属性
名称 描述
@Input()

cols: number

网格列表中的列数。

Amount of columns in the grid list.

@Input()

gutterSize: string

网格列表的装订线大小(以像素为单位)。

Size of the grid list's gutter in pixels.

@Input()

rowHeight: string | number

从用户提供的值中设置行高的内部表示形式。

Set internal representation of row height from the user-provided value.

选择器: mat-grid-tile
导出为: matGridTile
属性
名称 描述
@Input()

colspan: number

网格图块占用的列数。

Amount of columns that the grid tile takes up.

@Input()

rowspan: number

网格图块占用的行数。

Amount of rows that the grid tile takes up.

选择器: mat-grid-tile-header mat-grid-tile-footer

Angular Material grid-list-testing API 参考文档

import {MatGridTileHarness} from '@angular/material/grid-list/testing';

Harness for interacting with a standard MatGridTitle in tests.

方法
异步
getAllChildLoaders

参数

Parameters

selector

S

返回值

Returns

Promise<HarnessLoader[]>
异步
getAllHarnesses

参数

Parameters

query

HarnessQuery<T>

返回值

Returns

Promise<T[]>
异步
getChildLoader

参数

Parameters

selector

S

返回值

Returns

Promise<HarnessLoader>
异步
getColspan

Gets the amount of columns that the grid-tile takes up.

返回值

Returns

Promise<number>
异步
getFooterText

Gets the text of the footer if present.

返回值

Returns

Promise<string | null>
异步
getHarness

参数

Parameters

query

HarnessQuery<T>

返回值

Returns

Promise<T>
异步
getHeaderText

Gets the text of the header if present.

返回值

Returns

Promise<string | null>
异步
getRowspan

Gets the amount of rows that the grid-tile takes up.

返回值

Returns

Promise<number>
异步
hasAvatar

Whether the grid-tile has an avatar.

返回值

Returns

Promise<boolean>
异步
hasFooter

Whether the grid-tile has a footer.

返回值

Returns

Promise<boolean>
异步
hasHeader

Whether the grid-tile has a header.

返回值

Returns

Promise<boolean>
异步
host

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

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

返回值

Returns

Promise<TestElement>

Harness for interacting with a standard MatGridList in tests.

方法
异步
getColumns

Gets the amount of columns of the grid-list.

返回值

Returns

Promise<number>
异步
getTileAtPosition

Gets a tile of the grid-list that is located at the given location.

参数

Parameters

row

Zero-based row index.

column

Zero-based column index.

__0

{ row

返回值

Returns

Promise<MatGridTileHarness>
异步
getTiles

Gets all tiles of the grid-list.

参数

Parameters

filters

GridTileHarnessFilters = {}

返回值

Returns

Promise<MatGridTileHarness[]>
异步
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 MatGridListHarness instances.

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

属性
名称 描述

footerText: string | RegExp

Text the grid-tile footer should match.

headerText: string | RegExp

Text the grid-tile header should match.