ListView
此内容尚不支持你的语言。
Defined in: ui/collection/list-view.ts:73
Virtualized list driver. Owns a ViewPool + DataSource subscription;
on each update() computes the visible index range and syncs the
mounted item set to match.
Does not own input — callers drive scrolling by calling
setScrollOffset(). Typical wiring: a ScrollContainer primitive (or
the app’s input layer) computes a new offset and pushes it in.
Type Parameters
Section titled “Type Parameters”T = unknown
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ListView<
T>(opts):ListView<T>
Defined in: ui/collection/list-view.ts:90
Parameters
Section titled “Parameters”Returns
Section titled “Returns”ListView<T>
Methods
Section titled “Methods”dispose()
Section titled “dispose()”dispose():
void
Defined in: ui/collection/list-view.ts:221
Release all mounted items and tear down subscriptions.
Returns
Section titled “Returns”void
getContentSize()
Section titled “getContentSize()”getContentSize():
Vec2
Defined in: ui/collection/list-view.ts:131
Total size of the content for the current data count.
Returns
Section titled “Returns”getMountedCount()
Section titled “getMountedCount()”getMountedCount():
number
Defined in: ui/collection/list-view.ts:141
Number of entities currently mounted (useful for virtualization tests).
Returns
Section titled “Returns”number
getViewport()
Section titled “getViewport()”getViewport():
Rect
Defined in: ui/collection/list-view.ts:121
Current visible window within the content, in content-local coords.
Returns
Section titled “Returns”Rect
getVisibleRange()
Section titled “getVisibleRange()”getVisibleRange(): [
number,number]
Defined in: ui/collection/list-view.ts:136
Strict visible index range [start, end).
Returns
Section titled “Returns”[number, number]
refresh()
Section titled “refresh()”refresh():
void
Defined in: ui/collection/list-view.ts:159
Mark the mount set dirty — the next update() will re-sync.
Returns
Section titled “Returns”void
setScrollOffset()
Section titled “setScrollOffset()”setScrollOffset(
offset):void
Defined in: ui/collection/list-view.ts:145
Parameters
Section titled “Parameters”offset
Section titled “offset”Returns
Section titled “Returns”void
setViewportSize()
Section titled “setViewportSize()”setViewportSize(
size):void
Defined in: ui/collection/list-view.ts:151
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
update()
Section titled “update()”update():
void
Defined in: ui/collection/list-view.ts:167
Sync mounted items to the current viewport + data source. Cheap when nothing has changed (short-circuits on !dirty).
Returns
Section titled “Returns”void