用于存放一行中显示的一组 Button 对象。
适用于 Google Workspace 插件和 Google Chat 应用。
const textButton = CardService.newTextButton(); // Finish building the text button... const imageButton = CardService.newImageButton(); // Finish building the image button... const buttonSet = CardService.newButtonSet().addButton(textButton).addButton(imageButton);
方法
| 方法 | 返回类型 | 简介 |
|---|---|---|
add | Button | 添加按钮。 |
add | Widget | 添加可在 widget 上执行的事件操作。 |
set | Widget | 设置用于标识要发生变异的 widget 的唯一 ID。 |
set | Widget | 设置 widget 的可见性。 |
详细文档
add Event Action(eventAction)
set Id(id)
设置用于标识要发生变异的 widget 的唯一 ID。只有在插件中支持 widget 突变。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
id | String | 微件的 ID,最多可包含 64 个字符,格式为 `[a-zA-Z0-9-]+`。 |
返回
Widget - 此对象,用于链式调用。