SelectorQuery.selectAll
收藏我的收藏
基础库 1.7.0 开始支持本方法,这是一个同步方法。
语法
SelectorQuery.selectAll(selector)
参数说明
selector
类型 | 默认值 | 必填 | 说明 | 最低支持版本 |
string | | 是 | 选择器字符串 | 1.0.0 |
选择器说明
选择器字符串类似于在 CSS 中使用的选择器,但仅支持下列语法:
- •ID 选择器:
#the-id
- •class 选择器(可以连续指定多个):
.a-class.another-class
- •子元素选择器:
.the-parent > .the-child
- •后代选择器:
.the-ancestor .the-descendant
- •跨自定义组件的后代选择器:
.the-ancestor >>> .the-descendant
- •多选择器的并集:
#a-node, .some-other-nodes
返回值
扫码体验
代码示例
Bug & Tip
无。