8000 feat(useDraggable): improve component props (#3075) · vueuse/vueuse@6b6701c · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 6b6701c

Browse files
feat(useDraggable): improve component props (#3075)
1 parent b17010f commit 6b6701c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/core/useDraggable/component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ export const UseDraggable = /*#__PURE__*/ defineComponent<UseDraggableProps>({
3131
'as',
3232
'handle',
3333
'axis',
34+
'onStart',
35+
'onMove',
36+
'onEnd',
3437
] as unknown as undefined,
3538
setup(props, { slots }) {
3639
const target = ref()
@@ -45,7 +48,8 @@ export const UseDraggable = /*#__PURE__*/ defineComponent<UseDraggableProps>({
4548
: undefined,
4649
)
4750
const initialValue = storageValue || props.initialValue || { x: 0, y: 0 }
48-
const onEnd = (position: Position) => {
51+
const onEnd = (position: Position, event: PointerEvent) => {
52+
props.onEnd?.(position, event)
4953
if (!storageValue)
5054
return
5155
storageValue.value.x = position.x

0 commit comments

Comments
 (0)
0