swan.createSelectorQuery

解释:返回一个 SelectorQuery 对象实例。可以在这个实例上使用 select 等方法选择节点,并使用 boundingClientRect 等方法选择需要查询的信息。

方法参数

返回值

SelectorQuery

示例

跳转编辑工具

在开发者工具中打开

在 WEB IDE 中打开

扫码体验

代码示例

百度智能小程序

请使用百度APP扫码

图片示例

swan.createSelectorQuery - 图2

代码示例

  • SWAN
  • JS
  • CSS
  1. <view class="wrap">
  2. <view class="card-area">
  3. <movable-area>
  4. <movable-view class="target" x="{{x}}" y="{{y}}" direction="all" bindchange="queryNodeInfo">
  5. Drag
  6. </movable-view>
  7. </movable-area>
  8. <view s-for="item in metrics" class="list-area border-bottom">
  9. <text class="list-item-key-4">{{item.key}}</text>
  10. <text class="list-item-value">{{item.val}}</text>
  11. </view>
  12. </view>
  13. </view>