画布
ac.drawCanvas
向指定画布绘制图形指令。
无需权限
宿主 API
功能描述
向指定画布绘制图形指令。
调用方式
const result = await ac.drawCanvas({
"canvasId": "string",
"commands": []
});
参数说明
| 属性 | 类型 | 必填 | 说明 |
|---|---|---|---|
canvasId | string | 是 | - |
commands | array | 是 | - |
{
"type": "object",
"required": [
"canvasId",
"commands"
],
"properties": {
"canvasId": {
"type": "string"
},
"commands": {
"type": "array"
}
}
}
返回值
{
"type": "object"
}
错误码
该 API 当前没有声明专属错误码。
Manifest 声明
Agent 生成小程序时,如果页面会调用该 API,应在 manifest.apisUsed 中声明完整 API 名称。
{
"permissions": [],
"apisUsed": [
"ac.drawCanvas"
]
}
平台支持
| 平台 | 支持情况 |
|---|---|
| Web | 支持 |
| Android SDK | 支持 |
| iOS SDK | 支持 |
| Flutter SDK | 支持 |