Version: 1.x
Taro.createSelectorQuery()
返回一个 SelectorQuery 对象实例。可以在这个实例上使用 select 等方法选择节点,并使用 boundingClientRect 等方法选择需要查询的信息。
#
示例代码#
API支持度API | 微信小程序 | H5 | React Native |
---|---|---|---|
Taro.createSelectorQuery | ✔️ | ✔️ | |
selectorQuery.in | ✔️ | ✔️ | |
selectorQuery.select | ✔️ | ✔️ | |
selectorQuery.selectAll | ✔️ | ✔️ | |
selectorQuery.selectViewport | ✔️ | ✔️ | |
nodesRef.boundingClientRect | ✔️ | ✔️ | |
nodesRef.scrollOffset | ✔️ | ✔️ | |
nodesRef.fields | ✔️ | ✔️ | |
selectorQuery.exec | ✔️ | ✔️ |