Class CarouselCard
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
ThẻBăng chuyền
Thẻ có thể hiển thị dưới dạng mục băng chuyền.
Có sẵn cho các tiện ích bổ sung của Google Workspace và ứng dụng Google Chat.
const carouselCard = CardService.newCarouselCard()
.addWidget(
CardService.newTextParagraph().setText('a text paragraph in the carousel card'))
.addFooterWidget(
CardService.newTextParagraph().setText('a text paragraph in the carousel card footer'));
Tài liệu chi tiết
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eCarouselCard is a type of card designed for use in carousels within Google Workspace add-ons and Google Chat apps.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eaddFooterWidget(widget)\u003c/code\u003e method lets you add a widget to the footer area of the CarouselCard, with widgets displayed in the order they are added.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eaddWidget(widget)\u003c/code\u003e method is used to add a widget to the main content area of the CarouselCard, and widgets are shown in the order added.\u003c/p\u003e\n"],["\u003cp\u003eCarouselCard is accessible as part of the Google Workspace Developer Preview Program, allowing developers to get early access to features.\u003c/p\u003e\n"]]],[],null,["# Class CarouselCard\n\nCarouselCard\n\nA card that can be displayed as a carousel item.\n\nAvailable for Google Workspace add-ons and Google Chat apps.\n\n```javascript\nconst carouselCard = CardService.newCarouselCard()\n .addWidget(\n CardService.newTextParagraph().setText('a text paragraph in the carousel card'))\n .addFooterWidget(\n CardService.newTextParagraph().setText('a text paragraph in the carousel card footer'));\n```\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### Methods\n\n| Method | Return type | Brief description |\n|-----------------------------------------------------|-------------------|------------------------------------------------------------|\n| [addFooterWidget(widget)](#addFooterWidget(Widget)) | [CarouselCard](#) | Adds the given widget to the footer of this carousel card. |\n| [addWidget(widget)](#addWidget(Widget)) | [CarouselCard](#) | Adds the given widget to this carousel card. |\n\nDetailed documentation\n----------------------\n\n### `add``Footer``Widget(widget)`\n\nAdds the given widget to the footer of this carousel card. Widgets are shown in the order they\nwere added.\n\n```javascript\nconst carouselCard = CardService.newCarouselCard()\n .addFooterWidget(\n CardService.newTextParagraph().setText('a text paragraph in the carousel card footer'));\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|----------|------------------------------------------------------|-----------------------------------------------------|\n| `widget` | [Widget](/apps-script/reference/card-service/widget) | A widget to add to the footer of the carousel card. |\n\n#### Return\n\n\n[CarouselCard](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `add``Widget(widget)`\n\nAdds the given widget to this carousel card. Widgets are shown in the order they were added.\n\n```javascript\nconst carouselCard = CardService.newCarouselCard()\n .addWidget(\n CardService.newTextParagraph().setText('a text paragraph in the carousel card'));\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|----------|------------------------------------------------------|---------------------------------------|\n| `widget` | [Widget](/apps-script/reference/card-service/widget) | A widget to add to the carousel card. |\n\n#### Return\n\n\n[CarouselCard](#) --- This object, for chaining."]]