Search
Create a SelectorQuery with the root node of the page as the root.
SelectorQuery
createSelectorQuery(): SelectorQuery;
None.
A SelectorQuery object with the root node of the page as the root.
Obtain the position and size of the specified text node:
text
import { useEffect } from '@lynx-js/react'; function App() { useEffect(() => { lynx .createSelectorQuery() // create SelectorQuery .select('#my-id') // Specify the selector of the target node .invoke({ // Specify the operation for the target node method: 'boundingClientRect', success: function (res) { console.log(res); }, fail: function (res) { console.log(res.code, res.data); }, }) .exec(); // Execute the query }, []); return ( <view> <text id="my-id">Hello, ReactLynx</text> </view> ); }
LCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.