Back to Uni App

Page Container

docs/component/page-container.md

2.3.34.9 KB
Original Source
<!-- ## page-container -->

::: sourceCode

page-container

:::

页面容器组件,用于在页面内创建弹出层效果,支持拦截返回操作

兼容性

Web微信小程序AndroidiOSHarmonyOSHarmonyOS(Vapor)
5.024.415.025.025.025.02

属性

名称类型默认值兼容性描述
showbooleanfalseWeb: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02是否显示容器组件
durationnumber300Web: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02动画时长,单位毫秒
z-indexnumber100Web: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02z-index 层级
overlaybooleantrueWeb: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02是否显示遮罩层
roundbooleanfalseWeb: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02是否显示圆角
positiontop | left | bottom | right | center"bottom"Web: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02弹出位置,可选值为 top left bottom right center
close-on-slide-downbooleanfalseWeb: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02是否在下滑一段距离后关闭
overlay-stylestring-Web: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02自定义遮罩层样式
custom-stylestring-Web: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02自定义弹出层样式
@beforeenterAny-Web: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02进入前触发
@enterAny-Web: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02进入中触发
@afterenterAny-Web: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02进入后触发
@beforeleaveAny-Web: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02离开前触发
@leaveAny-Web: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02离开中触发
@afterleaveAny-Web: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02离开后触发
@clickoverlay(event: UniPointerEvent) => void-Web: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02点击遮罩层时触发

position 的属性描述

合法值兼容性描述
topWeb: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02顶部
leftWeb: 5.02; 微信小程序: x; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02左侧
bottomWeb: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02底部
rightWeb: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02右侧
centerWeb: 5.02; 微信小程序: 4.41; Android: 5.02; iOS: 5.02; HarmonyOS: 5.02; HarmonyOS(Vapor): 5.02居中
<!-- UTSCOMJSON.page-container.component_type -->

参见