保留一組以列顯示的 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 | 新增方塊。 |
set | Chip | 設定方塊清單版面配置。 |
內容詳盡的說明文件
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:這個物件用於鏈結。