Class FixedFooter

FixedFooter

固定页脚,显示在 Card 的底部。

适用于 Google Workspace 插件和 Google Chat 应用。

const fixedFooter = CardService.newFixedFooter().setPrimaryButton(
    CardService.newTextButton().setText('help').setOpenLink(
        CardService.newOpenLink().setUrl('http://www.google.com')),
);

方法

方法返回值类型简介
setPrimaryButton(button)FixedFooter设置固定页脚中的主要按钮。
setSecondaryButton(button)FixedFooter设置固定页脚中的次要按钮。

详细文档

setPrimaryButton(button)

设置固定页脚中的主要按钮。主要按钮必须是 TextButtonStyle.FILLED 按钮。如果未设置主要按钮的背景颜色,则该 按钮会使用插件清单中定义的主要颜色。

参数

名称类型说明
buttonTextButton要添加的按钮。

返回

FixedFooter - 此对象,用于链式调用。


setSecondaryButton(button)

设置固定页脚中的次要按钮。次要按钮必须是 TextButtonStyle.OUTLINED 按钮。如果未调用 setPrimaryButton(button) 来设置主要按钮,此方法不会执行任何操作。

参数

名称类型说明
buttonTextButton要添加的按钮。

返回

FixedFooter - 此对象,用于链式调用。