bn.createSelectorQuery
▸ createSelectorQuery(component?): SelectorQuery
description Returns a SelectorQuery Object instance which contains information or method of selected node.
example
bn.createSelectorQuery()
.select('#canvas')
.fields({ node: true, size: true })
.exec(res => {
const canvas = res[0].node
const ctx = canvas.getContext('2d')
ctx.fillRect(0, 0, 100, 100)
})
Parameters
| Name | Type |
|---|---|
component? | ComponentInstance |
Returns
SelectorQuery
Interface: ComponentInstance
| Name | Type | Description |
|---|---|---|
| id | string | instance id |
| getPageId | (): number | renderer id |
getPageId
▸ getPageId(): number
renderer id
Returns
number