ion-backdrop
Backdropは、他のコンポーネントをオーバーレイするためフルスクリーンのコンポーネントです。これらは、他のコンテンツの上に遷移するコンポーネントのバックグラウンドで役立ち、そのコンポーネントを削除するために使用できます。
基本的な使い方
Backdropは、その後ろのコンテンツをクリックしたりタップしたりするのを防ぎます。デフォルトでは透明なので、下のデモではCSSで見えるようにしています。
- src/app/example.component.html
- src/app/example.component.css
- src/app/example.component.ts
<ion-backdrop [visible]="true"></ion-backdrop>
<div class="ion-page">
<ion-header>
<ion-toolbar>
<ion-title>Backdrop</ion-title>
</ion-toolbar>
</ion-header>
<ion-content class="ion-padding">
<ion-item>
<ion-checkbox>Checkbox</ion-checkbox>
</ion-item>
<ion-button expand="block">Button</ion-button>
</ion-content>
</div>
スタイリング
バックドロップは、CSSプロパティをバックドロップ要素に直接割り当てることで、カスタマイズすることができます。一般的なプロパティには background-color
, background
, opacity
があります。
コンテンツに z-index
を設定し、背景よりも高い位置に表示させることができます(デフォルトは 2
です)。
- src/app/example.component.html
- src/app/example.component.css
- src/app/example.component.ts
<ion-backdrop [visible]="true"></ion-backdrop>
<div class="ion-page">
<ion-header>
<ion-toolbar>
<ion-title>Backdrop</ion-title>
</ion-toolbar>
</ion-header>
<ion-content class="ion-padding">
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Esse, cum aspernatur cupiditate nesciunt totam
perspiciatis delectus soluta laboriosam, ullam impedit porro eaque laborum optio natus sed nostrum, provident
expedita vero!
</p>
</ion-content>
</div>
<div id="box">
<ion-checkbox color="light"></ion-checkbox>
<ion-button class="ion-margin-start" color="light">Clickable</ion-button>
</div>
プロパティ
stopPropagation
Description | If true , the backdrop will stop propagation on tap. |
Attribute | stop-propagation |
Type | boolean |
Default | true |
tappable
Description | If true , the backdrop will can be clicked and will emit the ionBackdropTap event. |
Attribute | tappable |
Type | boolean |
Default | true |
visible
Description | If true , the backdrop will be visible. |
Attribute | visible |
Type | boolean |
Default | true |
イベント
Name | Description | Bubbles |
---|---|---|
ionBackdropTap | Emitted when the backdrop is tapped. | true |
メソッド
No public methods available for this component.
CSS Shadow Parts
No CSS shadow parts available for this component.
CSSカスタムプロパティ
No CSS custom properties available for this component.
Slots
No slots available for this component.