Skip to content

⬅️ Back to Table of Contents

📄 directive.ts

📊 Analysis Summary

Metric Count
🔧 Functions 1
📦 Imports 3
📊 Variables & Constants 1
📑 Type Aliases 2

📚 Table of Contents

🛠️ File Location:

📂 packages/core/onLongPress/directive.ts

📦 Imports

Name Source
ObjectDirective vue
OnLongPressOptions ./index
onLongPress ./index

Variables & Constants

Name Type Kind Value Exported
vOnLongPress `ObjectDirective<
HTMLElement,
BindingValueFunction BindingValueArray
>| const |{
mounted(el, binding) {
if (typeof binding.value === 'function')
onLongPress(el, binding.value, { modifiers: binding.modifiers })
else
onLongPress(el, ...binding.value)
},
}`

Functions

mounted(el: any, binding: any): void

Code
mounted(el, binding) {
    if (typeof binding.value === 'function')
      onLongPress(el, binding.value, { modifiers: binding.modifiers })
    else
      onLongPress(el, ...binding.value)
  }
  • Parameters:
  • el: any
  • binding: any
  • Return Type: void
  • Calls:
  • onLongPress (from ./index)

Type Aliases

BindingValueFunction

type BindingValueFunction = (evt: PointerEvent) => void;

BindingValueArray

type BindingValueArray = [
  BindingValueFunction,
  OnLongPressOptions,
];