轮播界面(也称为滑块)会旋转并以幻灯片格式显示微件列表,并提供用于导航到上一个或下一个微件的按钮。
适用于 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')))
方法
| 方法 | 返回类型 | 简介 | 
|---|---|---|
| add | Carousel | 添加轮播卡片。 | 
详细文档
add
添加轮播卡片。
const carousel = CardService.newCarousel() .addCarouselCard(CardService.newCarouselCard().addWidget( CardService.newTextParagraph().setText('The first text paragraph in carousel')));
参数
| 名称 | 类型 | 说明 | 
|---|---|---|
| card | Carousel | 要添加的轮播卡片。 | 
返回
Carousel - 此对象,用于链式调用。