水平方向の分割線。アドオンカードに区切り線を追加するには、Card 内で new メソッドを使用します。たとえば、次のサンプルでは、区切り線で区切られた 2 つの段落を含むシンプルなカードを作成します。
function buildCard() { const cardSection1TextParagraph1 = CardService.newTextParagraph().setText('Hello world!'); const cardSection1Divider1 = CardService.newDivider(); const cardSection1TextParagraph2 = CardService.newTextParagraph().setText('Hello world!'); const cardSection1 = CardService.newCardSection() .addWidget(cardSection1TextParagraph1) .addWidget(cardSection1Divider1) .addWidget(cardSection1TextParagraph2); const card = CardService.newCardBuilder().addSection(cardSection1).build(); return card; }
メソッド
| メソッド | 戻り値の型 | 概要 |
|---|---|---|
add | Widget | ウィジェットで実行できるイベント アクションを追加します。 |
set | Widget | 変更するウィジェットの識別に使用される一意の ID を設定します。 |
set | Widget | ウィジェットの可視性を設定します。 |
詳細なドキュメント
add Event Action(eventAction)
ウィジェットで実行できるイベント アクションを追加します。
パラメータ
| 名前 | 型 | 説明 |
|---|---|---|
event | Event | 追加する Event。 |
戻る
Widget - チェーン用の Object。
set Id(id)
変更するウィジェットの識別に使用される一意の ID を設定します。ウィジェットの変更はアドオンでのみサポートされています。
パラメータ
| 名前 | 型 | 説明 |
|---|---|---|
id | String | ウィジェットの ID。64 文字以内で、`[a-zA-Z0-9-]+` の形式で指定します。 |
戻る
Widget - チェーン用のこのオブジェクト。
set Visibility(visibility)
ウィジェットの可視性を設定します。デフォルト値は `VISIBLE` です。
パラメータ
| 名前 | 型 | 説明 |
|---|---|---|
visibility | Visibility | ウィジェットの Visibility。 |
戻る
Widget - チェーン用の Object。