ion-backdrop
背景遮罩层是一种全屏组件,会覆盖在其他组件之上。它们通常用于在内容上层切换显示的组件背后,并且可以用来关闭该组件。
基本用法
背景遮罩层会阻止点击或触摸其背后的内容。默认情况下它是透明的,因此下面的演示示例添加 了 CSS 样式使其可见。
样式设置
通过直接设置背景遮罩层元素的 CSS 属性,可以对其进行自定义。常用的属性包括 background-color、background 和 opacity。
通过在内容上设置比背景遮罩层(默认为 2)更高的 z-index,可以在遮罩层上方显示内容。
属性
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.
插槽
No slots available for this component.