Back to Uni App

Draggable Sheet

docs/component/draggable-sheet.md

2.3.33.0 KB
Original Source
<!-- ## draggable-sheet -->

::: sourceCode

draggable-sheet

:::

兼容性

Web微信小程序AndroidiOSHarmonyOSHarmonyOS(Vapor)
<a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a>4.41<a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a><a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a><a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a>-

属性

名称类型默认值兼容性描述
initial-child-sizenumber-Web: x; 微信小程序: 4.41; Android: x; iOS: x; HarmonyOS: x; HarmonyOS(Vapor): -(number)
初始时占父容器的比例
min-child-sizenumber-Web: x; 微信小程序: 4.41; Android: x; iOS: x; HarmonyOS: x; HarmonyOS(Vapor): -(number)
最小时占父容器的比例
max-child-sizenumber-Web: x; 微信小程序: 4.41; Android: x; iOS: x; HarmonyOS: x; HarmonyOS(Vapor): -(number)
最大时占父容器的比例
snapboolean-Web: x; 微信小程序: 4.41; Android: x; iOS: x; HarmonyOS: x; HarmonyOS(Vapor): -(boolean)
拖拽后是否自动对齐关键点
snap-sizesArray.<number>-Web: x; 微信小程序: 4.41; Android: x; iOS: x; HarmonyOS: x; HarmonyOS(Vapor): -(Array.<number>)
拖拽后对齐的关键点,无需包含最小和最大值
worklet:onsizeupdateworklet-Web: x; 微信小程序: 4.41; Android: x; iOS: x; HarmonyOS: x; HarmonyOS(Vapor): -(worklet)
尺寸发生变化时触发,仅支持 worklet 作为回调。event = {pixels, size}
<!-- UTSCOMJSON.draggable-sheet.component_type -->

参见