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)
เพิ่มชิป
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
chip | Chip | ชิปที่จะเพิ่ม |
รีเทิร์น
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);
พารามิเตอร์
รีเทิร์น
ChipList
— ออบเจ็กต์นี้สําหรับการต่อเชื่อม
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eChipList displays a set of Chip objects in a row, wrapping to the next line or horizontally scrolling.\u003c/p\u003e\n"],["\u003cp\u003eIt's available for Google Chat apps and in developer preview for Google Workspace Add-ons.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use \u003ccode\u003eaddChip()\u003c/code\u003e to add chips and \u003ccode\u003esetLayout()\u003c/code\u003e to configure the layout of the ChipList.\u003c/p\u003e\n"]]],[],null,["# Class ChipList\n\nChipList\n\nHolds a set of [Chip](/apps-script/reference/card-service/chip) objects that are displayed in a row, wrapping to the next line to\nhorizontal scrollable.\n\nAvailable for Google Chat apps. In developer preview for Google Workspace add-ons.\n\n\n| **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features.\n\n\u003cbr /\u003e\n\n```javascript\nconst chip = CardService.newChip();\n// Finish building the text chip...\n\nconst chipList = CardService.newChipList()\n .setLayout(CardService.ChipListLayout.WRAPPED)\n .addChip(chip);\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|-------------------------------------------------|---------------|----------------------------|\n| [addChip(chip)](#addChip(Chip)) | [ChipList](#) | Adds a chip. |\n| [setLayout(layout)](#setLayout(ChipListLayout)) | [ChipList](#) | Sets the chip list layout. |\n\nDetailed documentation\n----------------------\n\n### `add``Chip(chip)`\n\nAdds a chip.\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|--------------------------------------------------|------------------|\n| `chip` | [Chip](/apps-script/reference/card-service/chip) | The chip to add. |\n\n#### Return\n\n\n[ChipList](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Layout(layout)`\n\nSets the chip list layout. If unset, it defaults to [ChipListLayout.WRAPPED](/apps-script/reference/card-service/chip-list-layout#WRAPPED) layout.\n\n```javascript\nconst chip = CardService.newChip();\n// Finish building the text chip...\n\nconst chipList =\n CardService.newChipList()\n .setLayout(CardService.ChipListLayout.HORIZONTAL_SCROLLABLE)\n .addChip(chip);\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|----------|------------------------------------------------------------------------|-----------------------|\n| `layout` | [ChipListLayout](/apps-script/reference/card-service/chip-list-layout) | The chip list layout. |\n\n#### Return\n\n\n[ChipList](#) --- This object, for chaining."]]