diff --git a/packages/core/onLongPress/directive.ts b/packages/core/onLongPress/directive.ts index f660f65d410..bb32d6c9cac 100644 --- a/packages/core/onLongPress/directive.ts +++ b/packages/core/onLongPress/directive.ts @@ -17,7 +17,7 @@ BindingValueFunction | BindingValueArray > = { [directiveHooks.mounted](el, binding) { if (typeof binding.value === 'function') - onLongPress(el, binding.value) + onLongPress(el, binding.value, { modifiers: binding.modifiers }) else onLongPress(el, ...binding.value) }, diff --git a/packages/core/onLongPress/index.md b/packages/core/onLongPress/index.md index 3b57efd0f11..0e0f316fccb 100644 --- a/packages/core/onLongPress/index.md +++ b/packages/core/onLongPress/index.md @@ -6,6 +6,13 @@ category: Sensors Listen for a long press on an element. +Function provides modifiers in options + * stop + * once + * prevent + * capture + * self + ## Usage ```html @@ -23,7 +30,11 @@ const resetHook = () => { longPressedHook.value = false } -onLongPress(htmlRefHook, onLongPressCallbackHook) +onLongPress( + htmlRefHook, + onLongPressCallbackHook, + { modifiers: { prevent: true } } +)