包含一組以列顯示的 Chip 物件,會換行至下一行,以進行水平捲動。
適用於 Google Chat 擴充應用程式。Google Workspace 外掛程式的開發人員預覽版。
const chip = CardService.newChip(); // Finish building the text chip... const chipList = CardService.newChipList() .setLayout(CardService.ChipListLayout.WRAPPED) .addChip(chip);
方法
| 方法 | 傳回類型 | 簡短說明 |
|---|---|---|
add | Chip | 新增方塊。 |
add | Widget | 新增可在小工具上執行的事件動作。 |
set | Widget | 設定指派的專屬 ID,用於識別要變動的小工具。 |
set | Chip | 設定晶片清單版面配置。 |
set | Widget | 設定小工具的顯示設定。 |
內容詳盡的說明文件
add Event Action(eventAction)
set Id(id)
設定指派的專屬 ID,用於識別要變動的小工具。外掛程式僅支援小工具突變。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
id | String | 小工具的 ID,最多 64 個字元,格式為 `[a-zA-Z0-9-]+`。 |
回攻員
Widget - 這個物件,用於鏈結。
set Layout(layout)
設定動態磚清單版面配置。如未設定,則預設為 Chip 版面配置。
const chip = CardService.newChip(); // Finish building the text chip... const chipList = CardService.newChipList() .setLayout(CardService.ChipListLayout.HORIZONTAL_SCROLLABLE) .addChip(chip);
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
layout | Chip | 方塊清單版面配置。 |
回攻員
Chip - 這個物件,用於鏈結。