force:showToast
トーストによって、ビューの上部のヘッダーの下にメッセージが表示されます。メッセージは message 属性で指定されます。
次の例では、トーストメッセージ「Success! The record has been updated successfully.」が表示されます。
1showToast : function(component, event, helper) {
2 var toastEvent = $A.get("e.force:showToast");
3 toastEvent.setParams({
4 "title": "Success!",
5 "message": "The record has been updated successfully."
6 });
7 toastEvent.fire();
8}| 属性名 | 型 | 説明 |
|---|---|---|
| title | String | トーストの太字のタイトルを指定します。 |
| message | String | 表示するメッセージを指定します。 |
| key | String | アイコンの種類を指定します。 |
| duration | Integer | トーストの期間 (ミリ秒)。デフォルトは 3,000 ミリ秒です。 |