Class Carousel
轮播界面
轮播界面(也称为滑块)会旋转并以幻灯片格式显示微件列表,并提供用于导航到上一个或下一个微件的按钮。
适用于 Google Workspace 插件和 Google Chat 应用。
const carousel =
CardService.newCarousel()
.addCarouselCard(CardService.newCarouselCard().addWidget(
CardService.newTextParagraph().setText('The first text paragraph in carousel')))
.addCarouselCard(CardService.newCarouselCard().addWidget(
CardService.newTextParagraph().setText('The second text paragraph in carousel')))
.addCarouselCard(CardService.newCarouselCard().addWidget(
CardService.newTextParagraph().setText('The third text paragraph in carousel')))
详细文档
addCarouselCard(card)
添加轮播卡片。
const carousel =
CardService.newCarousel()
.addCarouselCard(CardService.newCarouselCard().addWidget(
CardService.newTextParagraph().setText('The first text paragraph in carousel')));
参数
返回
Carousel
- 此对象,用于链式调用。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-01-30。
[null,null,["最后更新时间 (UTC):2025-01-30。"],[[["Carousel, also known as a slider, displays widgets in a rotating slideshow format with navigation buttons."],["Carousels are available for use in Google Workspace add-ons and Google Chat apps."],["The `addCarouselCard(card)` method is used to add a carousel card to the carousel, and it returns the Carousel object for chaining."],["Carousels are currently part of the Google Workspace Developer Preview Program, providing early access to this feature."]]],["Carousel, or slider, displays widgets in a slideshow format, navigable via buttons. It's available for Google Workspace add-ons and Google Chat apps. Developers use `CardService.newCarousel()` to create it. `addCarouselCard(card)` method adds individual cards, such as text paragraphs, to the carousel. Each card can be created using `CardService.newCarouselCard()`. This method returns the Carousel object, allowing for chaining of card additions. This is available in the Google Workspace Developer Preview Program.\n"]]