element_getInnerElement
Retrieve specific elements within a WeChat Mini Program component using CSS selectors. This tool helps developers locate and interact with nested elements inside custom components for testing and automation purposes.
Instructions
在元素范围内获取元素,相当于 element.$(selector)。重要:操作自定义组件内部元素时,必须先通过 ID 选择器(如 #my-component)定位自定义组件,然后使用此工具获取组件内部的元素。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection | No | ||
| selector | Yes | ||
| innerSelector | No | ||
| targetSelector | Yes |
Input Schema (JSON Schema)
{
"properties": {
"connection": {
"additionalProperties": false,
"properties": {
"account": {
"minLength": 1,
"type": "string"
},
"args": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
},
{
"not": {}
}
]
},
"autoClose": {
"type": "boolean"
},
"cliPath": {
"minLength": 1,
"type": "string"
},
"cwd": {
"minLength": 1,
"type": "string"
},
"mode": {
"enum": [
"launch",
"connect"
],
"type": "string"
},
"port": {
"exclusiveMinimum": 0,
"type": "integer"
},
"projectPath": {
"minLength": 1,
"type": "string"
},
"ticket": {
"minLength": 1,
"type": "string"
},
"timeout": {
"exclusiveMinimum": 0,
"type": "integer"
},
"trustProject": {
"type": "boolean"
},
"wsEndpoint": {
"minLength": 1,
"type": "string"
}
},
"type": "object"
},
"innerSelector": {
"minLength": 1,
"type": "string"
},
"selector": {
"minLength": 1,
"type": "string"
},
"targetSelector": {
"minLength": 1,
"type": "string"
}
},
"required": [
"selector",
"targetSelector"
],
"type": "object"
}