跳转到内容

DataSource

此内容尚不支持你的语言。

Defined in: ui/collection/data-source.ts:22

Abstract backing store for a virtualized list. Producers implement getCount + getItem at minimum; optional methods provide heterogeneous item types, stable identity for diffing, and change notifications so consumers can mark themselves dirty.

T = unknown

getCount(): number

Defined in: ui/collection/data-source.ts:23

number


getItem(index): T

Defined in: ui/collection/data-source.ts:24

number

T


optional getItemId(index, item): string | number

Defined in: ui/collection/data-source.ts:28

Stable identity to support future reorder-aware diffing.

number

T

string | number


optional getItemType(index): string

Defined in: ui/collection/data-source.ts:26

Defaults to 'default'. Used to route items to the matching template.

number

string


optional subscribe(listener): Unsubscribe

Defined in: ui/collection/data-source.ts:30

Subscribe to change notifications; returns an unsubscribe fn.

(change) => void

Unsubscribe