The data-*
field in the template
The id
field in the template
The component path in the code space
Cast the component into the specified type
Returns null
if the component node is not the instance of the specified component.
Create an intersection observer
Optional
options: { Optional
initialOptional
observeOptional
thresholds?: number[]Cast the component into a general-typed one
Group several data update calls
This method is designed for hinting the backend that some updates should be handled together. However, this is done automatically now, so this method is just for backward compatibilities.
Pending all data updates in the callback, and apply updates after callback returns
This function helps grouping several replaceDataOnPath
or spliceArrayDataOnPath
calls,
and then apply them at the end of the callback.
setData
and applyDataUpdates
calls inside the callback still apply updates immediately.
Check whether the other
behavior is a dependent behavior or a implemented trait behavior
Schedule a data update on a single specified path
The data update will not be applied until next setData
or applyDataUpdates
call.
All data observers will not be triggered immediately before applied.
Reads of the data will get the unchanged value before applied.
Query all elements inside the component
If componentType
is provided, this method will check the selected component type.
If a component type does not match, it is not returned.
Query an element inside the component
If componentType
is provided, this method will check the selected component type.
If the component type does not match, null
is returned.
Get the owner component
If componentType
is provided, this method will check the selected component type.
If a component type does not match, null
is returned.
Do a classic data update
The callback
is called after the update applies in the backend.
In most cases, you SHOULD NOT wait the backend update (that might be very slow),
and most calls, including read calls such as selectComponent
, simply works immediately.
However, when called inside observers,
the data update will not be applied to templates immediately
(it is recommanded to use updateData
instead in observers).
Optional
callback: (() => void)Schedule an array update
The behavior is like Array.prototype.slice
.
Break the array before the index
-th item, delete del
items, and insert some items here.
If index
is undefined, negative, or larger than the length of the array,
no items will be deleted and new items will be appended to the end of the array.
The data update will not be applied until next setData
or applyDataUpdates
call.
All data observers will not be triggered immediately before applied.
Reads of the data will get the unchanged value before applied.
Schedule a classic data updates
The data update will not be applied until next setData
or applyDataUpdates
call.
When called inside observers, the data update will be applied when observer ends.
All data observers will not be triggered immediately before applied.
Reads of the data will get the unchanged value before applied.
The corresponding
Component