NodesRef
Introduction
Node information.
Method Parameters
Method | Parameters | Description |
---|---|---|
boundingClientRect | Function callback | Adds a query request for the layout position of a node relative to the display area (unit: pixels). It functions similarly to getBoundingClientRect in the DOM. The return value is the selectorQuery corresponding to the nodesRef . |
fields | Object fields, Function callback | Retrieves relevant information about a node, with specific fields to be obtained specified in the fields parameter. The return value is the selectorQuery corresponding to the nodesRef . |
scrollOffset | Function callback | Adds a scroll position query request for a node (unit: pixels). The node must be a scroll-view or viewport. The return value is the selectorQuery corresponding to the nodesRef . |
Sample Code
Page({
onReady() {
let node = dlt.createSelectorQuery();
// Node's position information, for regular nodes
node.select('node').boundingClientRect((rect) => {});
// Node's relevant information, for regular nodes
node.select('node').scrollOffset().exec();
// Node's scroll position information, for special nodes
node.select('node').fields().exec();
},
});