跳到主要内容

获取子节点(:childrens)

函数

子节点对象数组 =  obj:childrens()

返回值

  • 节点对象数组 数组型
    • 成功返回对象 失败返回 nil

说明

该函数用来获取 节点信息的 所有子节点

此方法只能在 2.3.0以上版本中使用

示例


local node = nodeView.matchForMainWindow(function (info) --匹配节点信息 label==点赞 class==AWEFeedVideoButton 此函数返回节点对象数组 数组型
return info.label == "点赞" and info.class == "AWEFeedVideoButton"
end ,true) --第二个参数为 true 时 返回 对象数组
print(node[1]:childrens()[1]:info()) --打印出子节点中的 第一个节点信息