跳到主要内容
版本:v7

ion-backdrop

shadow

背景遮罩层是一种全屏组件,会覆盖在其他组件之上。它们通常用于在内容上层切换显示的组件背后,并且可以用来关闭该组件。

基本用法

背景遮罩层会阻止点击或触摸其背后的内容。默认情况下它是透明的,因此下面的演示示例添加了 CSS 样式使其可见。

样式设置

通过直接设置背景遮罩层元素的 CSS 属性,可以对其进行自定义。常用的属性包括 background-colorbackgroundopacity

通过在内容上设置比背景遮罩层(默认为 2)更高的 z-index,可以在遮罩层上方显示内容。

属性

stopPropagation

DescriptionIf true, the backdrop will stop propagation on tap.
Attributestop-propagation
Typeboolean
Defaulttrue

tappable

DescriptionIf true, the backdrop will can be clicked and will emit the ionBackdropTap event.
Attributetappable
Typeboolean
Defaulttrue

visible

DescriptionIf true, the backdrop will be visible.
Attributevisible
Typeboolean
Defaulttrue

事件

NameDescriptionBubbles
ionBackdropTapEmitted 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.