Class ChipList

方塊清單

保留一組以列顯示的 Chip 物件,並將其換行,以便水平捲動。

適用於 Google Chat 應用程式。在 Google Workspace 外掛程式的開發人員預覽版中。

const chip = CardService.newChip(); // Finish building the text chip...  const chipList = CardService.newChipList()                      .setLayout(CardService.ChipListLayout.WRAPPED)                      .addChip(chip);

方法

方法傳回類型簡短說明
addChip(chip)ChipList新增方塊。
setLayout(layout)ChipList設定方塊清單版面配置。

內容詳盡的說明文件

addChip(chip)

新增方塊。

參數

名稱類型說明
chipChip要新增的方塊。

回攻員

ChipList:這個物件用於鏈結。


setLayout(layout)

設定方塊清單版面配置。如果未設定,則預設為 ChipListLayout.WRAPPED 版面配置。

const chip = CardService.newChip(); // Finish building the text chip...  const chipList =     CardService.newChipList()         .setLayout(CardService.ChipListLayout.HORIZONTAL_SCROLLABLE)         .addChip(chip);

參數

名稱類型說明
layoutChipListLayout方塊清單版面配置。

回攻員

ChipList:這個物件用於鏈結。