⬅️ 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/useIntersectionObserver/directive.ts
📦 Imports
| Name |
Source |
ObjectDirective |
vue |
UseIntersectionObserverOptions |
./index |
useIntersectionObserver |
./index |
Variables & Constants
| Name |
Type |
Kind |
Value |
Exported |
vIntersectionObserver |
`ObjectDirective< |
|
|
|
| HTMLElement, |
|
|
|
|
| BindingValueFunction |
BindingValueArray |
|
|
|
>| const |{ |
|
|
|
|
| mounted(el, binding) { |
|
|
|
|
| if (typeof binding.value === 'function') |
|
|
|
|
| useIntersectionObserver(el, binding.value) |
|
|
|
|
| else |
|
|
|
|
| useIntersectionObserver(el, ...binding.value) |
|
|
|
|
| }, |
|
|
|
|
| }` |
✓ |
|
|
|
Functions
mounted(el: any, binding: any): void
Code
mounted(el, binding) {
if (typeof binding.value === 'function')
useIntersectionObserver(el, binding.value)
else
useIntersectionObserver(el, ...binding.value)
}
- Parameters:
el: any
binding: any
- Return Type:
void
- Calls:
useIntersectionObserver (from ./index)
Type Aliases
BindingValueFunction
type BindingValueFunction = IntersectionObserverCallback;
BindingValueArray
type BindingValueArray = [BindingValueFunction, UseIntersectionObserverOptions];