メインコンテンツまでスキップ
バージョン: v8

ion-alert

scoped

Properties

animated

Descriptiontrueの場合、アラートはアニメーションで表示されます。
Attributeanimated
Typeboolean
Defaulttrue

backdropDismiss

Descriptiontrueの場合、バックドロップがクリックされるとアラートが解除される。
Attributebackdrop-dismiss
Typeboolean
Defaulttrue

buttons

Descriptionアラートに追加されるボタンの配列。
Attributebuttons
Type(string | AlertButton)[]
Default[]

cssClass

DescriptionカスタムCSSに適用する追加のクラス。複数のクラスを指定する場合は、スペースで区切る必要があります。
Attributecss-class
Typestring | string[] | undefined
Defaultundefined

enterAnimation

Descriptionアラート提示時に使用するアニメーションです。
Attributeenter-animation
Type((baseEl: any, opts?: any) => Animation) | undefined
Defaultundefined
Descriptionアラートの見出しにあるメインタイトルです。
Attributeheader
Typestring | undefined
Defaultundefined

htmlAttributes

Descriptionアラートに渡す追加属性。
Attributehtml-attributes
Typeundefined | { [key: string]: any; }
Defaultundefined

inputs

Descriptionアラートに表示するInputの配列。
Attributeinputs
TypeAlertInput[]
Default[]

isOpen

Descriptiontrueの場合、アラートは開く。もし false ならば、アラートは閉じます。alertControllerやtriggerプロパティを使用してください。注意: アラートが終了しても isOpen は自動的に false に戻りません。あなたのコードでそれを行う必要があります。
Attributeis-open
Typeboolean
Defaultfalse

keyboardClose

Descriptiontrueの場合、オーバーレイが表示されたときにキーボードが自動的に解除されます。
Attributekeyboard-close
Typeboolean
Defaulttrue

leaveAnimation

Descriptionアラートが解除されたときに使用するアニメーション。
Attributeleave-animation
Type((baseEl: any, opts?: any) => Animation) | undefined
Defaultundefined

message

Descriptionアラートに表示されるメインメッセージ。messageには、文字列としてプレーンテキストまたはHTMLのいずれかを指定することができます。通常HTML用に予約されている文字を表示するには、エスケープする必要があります。例えば、<Ionic>&lt;Ionic&gt; になります:セキュリティ・ドキュメント このプロパティは、カスタムHTMLを文字列として受け付けます。デフォルトでは、コンテンツはプレーンテキストとしてパースされます。カスタムHTMLを使用するには、Ionicの設定で innerHTMLTemplatesEnabledtrue に設定する必要があります。
Attributemessage
TypeIonicSafeString | string | undefined
Defaultundefined

mode

Descriptionmodeは、どのプラットフォームのスタイルを使用するかを決定します。
Attributemode
Type"ios" | "md"
Defaultundefined

subHeader

Descriptionアラートの見出しにあるサブタイトルです。タイトルの下に表示されます。
Attributesub-header
Typestring | undefined
Defaultundefined

translucent

Descriptiontrueの場合、アラートは半透明になります。modeが "ios" で、デバイスが backdrop-filter をサポートしている場合にのみ適用されます。
Attributetranslucent
Typeboolean
Defaultfalse

trigger

Descriptionクリックされるとアラートが開くトリガー要素に対応するID。
Attributetrigger
Typestring | undefined
Defaultundefined

Events

NameDescription
didDismissアラートが解除された後に発行されます。ionAlertDidDismissの略記。
didPresentアラートが提示された後に発行されます。ionAlertWillDismissの略記。
ionAlertDidDismissアラートが解除された後に発行されます。
ionAlertDidPresentアラートが提示された後に発行されます。
ionAlertWillDismissアラートが解除される前に発行されます。
ionAlertWillPresentアラートが提示される前に発行されます。
willDismissアラートが解除される前に発行されます。ionAlertWillDismissの略記。
willPresentアラートが提示される前に発行されます。ionAlertWillPresentの略記。

Methods

dismiss

Descriptionアラートのオーバーレイが表示された後に閉じます。オーバーレイがまだ表示されていない場合は何もしません。表示されなかったオーバーレイを DOM から削除するには、remove メソッドを使用してください。
Signaturedismiss(data?: any, role?: string) => Promise<boolean>

onDidDismiss

Descriptionアラートが解除されたことを解決するPromiseを返します。
SignatureonDidDismiss<T = any>() => Promise<OverlayEventDetail<T>>

onWillDismiss

Descriptionアラートが解除されるタイミングを解決するPromiseを返します。
SignatureonWillDismiss<T = any>() => Promise<OverlayEventDetail<T>>

present

Descriptionアラートオーバーレイを作成した後に提示します。
Signaturepresent() => Promise<void>

CSS Custom Properties

NameDescription
--backdrop-opacity背景の不透明度
--backdrop-opacity背景の不透明度
--background注意喚起の背景
--background注意喚起の背景
--heightアラートの高さ
--heightアラートの高さ
--max-heightアラートの最大の高さ
--max-heightアラートの最大の高さ
--max-widthアラートの最大幅
--max-widthアラートの最大幅
--min-heightアラートの最小の高さ
--min-heightアラートの最小の高さ
--min-widthアラートの最小幅
--min-widthアラートの最小幅
--widthアラートの幅
--widthアラートの幅
View Source