directix 1.0.0-beta.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +98 -12
- package/dist/index.cjs +1095 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +121 -121
- package/dist/index.iife.js +1224 -0
- package/dist/index.iife.js.map +1 -0
- package/dist/index.iife.min.js +7 -0
- package/dist/{index.esm.js → index.mjs} +124 -62
- package/dist/index.mjs.map +1 -0
- package/package.json +106 -95
- package/dist/index.cjs.js +0 -2
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.esm.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,132 +4,132 @@ import { Plugin as Plugin_2 } from 'vue';
|
|
|
4
4
|
import { VNode } from 'vue';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Add cleanup function to element
|
|
8
8
|
*/
|
|
9
9
|
export declare function addCleanupVue2(el: Element, fn: () => void): void;
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Add cleanup function to element
|
|
13
13
|
*/
|
|
14
14
|
export declare function addCleanupVue3(el: Element, fn: () => void): void;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Directive binding value type
|
|
18
18
|
*/
|
|
19
19
|
export declare type ClickOutsideBinding = ClickOutsideHandler | ClickOutsideOptions;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Click outside handler
|
|
23
23
|
*/
|
|
24
24
|
export declare type ClickOutsideHandler = (event: MouseEvent | TouchEvent) => void;
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* Click outside directive options
|
|
28
28
|
*/
|
|
29
29
|
export declare interface ClickOutsideOptions {
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* Callback when clicking outside
|
|
32
32
|
* @required
|
|
33
33
|
*/
|
|
34
34
|
handler: ClickOutsideHandler;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Excluded element selectors or element references
|
|
37
37
|
*/
|
|
38
38
|
exclude?: (string | HTMLElement | (() => HTMLElement | null))[];
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* Whether to use capture mode
|
|
41
41
|
* @default true
|
|
42
42
|
*/
|
|
43
43
|
capture?: boolean;
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* Event types to listen for
|
|
46
46
|
* @default ['click']
|
|
47
47
|
*/
|
|
48
48
|
events?: ('click' | 'mousedown' | 'mouseup' | 'touchstart' | 'touchend')[];
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
50
|
+
* Whether to disable
|
|
51
51
|
* @default false
|
|
52
52
|
*/
|
|
53
53
|
disabled?: boolean;
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* Stop propagation
|
|
56
56
|
* @default false
|
|
57
57
|
*/
|
|
58
58
|
stop?: boolean;
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
60
|
+
* Prevent default behavior
|
|
61
61
|
* @default false
|
|
62
62
|
*/
|
|
63
63
|
prevent?: boolean;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
|
-
*
|
|
67
|
+
* Directive binding value type
|
|
68
68
|
*/
|
|
69
69
|
export declare type CopyBinding = string | CopyOptions;
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* Copy error callback
|
|
73
73
|
*/
|
|
74
74
|
export declare type CopyErrorCallback = (error: Error) => void;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
|
-
*
|
|
77
|
+
* Copy directive options
|
|
78
78
|
*/
|
|
79
79
|
export declare interface CopyOptions {
|
|
80
80
|
/**
|
|
81
|
-
*
|
|
81
|
+
* Text to copy
|
|
82
82
|
* @required
|
|
83
83
|
*/
|
|
84
84
|
value: string;
|
|
85
85
|
/**
|
|
86
|
-
*
|
|
86
|
+
* Callback on copy success
|
|
87
87
|
*/
|
|
88
88
|
onSuccess?: CopySuccessCallback;
|
|
89
89
|
/**
|
|
90
|
-
*
|
|
90
|
+
* Callback on copy error
|
|
91
91
|
*/
|
|
92
92
|
onError?: CopyErrorCallback;
|
|
93
93
|
/**
|
|
94
|
-
*
|
|
94
|
+
* Tooltip text for the copy button
|
|
95
95
|
*/
|
|
96
96
|
title?: string;
|
|
97
97
|
/**
|
|
98
|
-
*
|
|
98
|
+
* Whether to disable
|
|
99
99
|
* @default false
|
|
100
100
|
*/
|
|
101
101
|
disabled?: boolean;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
|
-
*
|
|
105
|
+
* Copy success callback
|
|
106
106
|
*/
|
|
107
107
|
export declare type CopySuccessCallback = (text: string) => void;
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
|
-
* Vue 2
|
|
110
|
+
* Vue 2 directive adapter
|
|
111
111
|
* @returns Vue 2 directive object with bind/inserted/update/unbind hooks
|
|
112
112
|
*/
|
|
113
113
|
export declare function createVue2Directive<T, B extends Element>(hooks: DirectiveHooks<T, B>): Record<string, any>;
|
|
114
114
|
|
|
115
115
|
/**
|
|
116
|
-
* Vue 3
|
|
116
|
+
* Vue 3 directive adapter
|
|
117
117
|
* @returns Vue 3 directive object with created/mounted/updated/unmounted hooks
|
|
118
118
|
*/
|
|
119
119
|
export declare function createVue3Directive<T, B extends Element>(hooks: DirectiveHooks<T, B>): Record<string, any>;
|
|
120
120
|
|
|
121
121
|
/**
|
|
122
|
-
*
|
|
122
|
+
* Cross-version directive type (compatible with Vue 2/3)
|
|
123
123
|
*/
|
|
124
124
|
export declare type CrossVersionDirective = Directive | Vue2DirectiveHooks | Vue3DirectiveHooks;
|
|
125
125
|
|
|
126
126
|
/**
|
|
127
|
-
*
|
|
127
|
+
* Directive binding value type
|
|
128
128
|
*/
|
|
129
129
|
export declare type DebounceBinding<T extends (...args: any[]) => any = any> = T | DebounceOptions<T>;
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
|
-
*
|
|
132
|
+
* Debounced function type
|
|
133
133
|
*/
|
|
134
134
|
export declare interface DebouncedFunction<T extends (...args: any[]) => any> {
|
|
135
135
|
(...args: Parameters<T>): void;
|
|
@@ -138,7 +138,7 @@ export declare interface DebouncedFunction<T extends (...args: any[]) => any> {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
/**
|
|
141
|
-
*
|
|
141
|
+
* Debounce function
|
|
142
142
|
*/
|
|
143
143
|
export declare function debounceFn<T extends (...args: any[]) => any>(func: T, wait?: number, options?: {
|
|
144
144
|
leading?: boolean;
|
|
@@ -149,49 +149,49 @@ export declare function debounceFn<T extends (...args: any[]) => any>(func: T, w
|
|
|
149
149
|
};
|
|
150
150
|
|
|
151
151
|
/**
|
|
152
|
-
*
|
|
152
|
+
* Debounce directive options
|
|
153
153
|
*/
|
|
154
154
|
export declare interface DebounceOptions<T extends (...args: any[]) => any = any> {
|
|
155
155
|
/**
|
|
156
|
-
*
|
|
156
|
+
* Function to debounce
|
|
157
157
|
*/
|
|
158
158
|
handler: T;
|
|
159
159
|
/**
|
|
160
|
-
*
|
|
160
|
+
* Delay time in milliseconds
|
|
161
161
|
* @default 300
|
|
162
162
|
*/
|
|
163
163
|
wait?: number;
|
|
164
164
|
/**
|
|
165
|
-
*
|
|
165
|
+
* Whether to invoke immediately before delay starts
|
|
166
166
|
* @default false
|
|
167
167
|
*/
|
|
168
168
|
leading?: boolean;
|
|
169
169
|
/**
|
|
170
|
-
*
|
|
170
|
+
* Whether to invoke after delay ends
|
|
171
171
|
* @default true
|
|
172
172
|
*/
|
|
173
173
|
trailing?: boolean;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
/**
|
|
177
|
-
*
|
|
177
|
+
* Deep clone an object
|
|
178
178
|
*/
|
|
179
179
|
export declare function deepClone<T>(obj: T): T;
|
|
180
180
|
|
|
181
181
|
/**
|
|
182
|
-
*
|
|
182
|
+
* Deep merge objects
|
|
183
183
|
*/
|
|
184
184
|
export declare function deepMerge<T extends Record<string, any>>(target: T, ...sources: Partial<T>[]): T;
|
|
185
185
|
|
|
186
186
|
/**
|
|
187
|
-
*
|
|
188
|
-
* @param definition
|
|
189
|
-
* @returns Vue
|
|
187
|
+
* Define a cross-version compatible directive
|
|
188
|
+
* @param definition The directive definition
|
|
189
|
+
* @returns Vue directive object
|
|
190
190
|
*/
|
|
191
191
|
export declare function defineDirective<T = any, B extends Element = Element>(definition: DirectiveDefinition<T, B>): Directive;
|
|
192
192
|
|
|
193
193
|
/**
|
|
194
|
-
*
|
|
194
|
+
* Define a directive group
|
|
195
195
|
*/
|
|
196
196
|
export declare function defineDirectiveGroup(name: string, directives: Record<string, any>): {
|
|
197
197
|
name: string;
|
|
@@ -200,229 +200,229 @@ export declare function defineDirectiveGroup(name: string, directives: Record<st
|
|
|
200
200
|
};
|
|
201
201
|
|
|
202
202
|
/**
|
|
203
|
-
*
|
|
203
|
+
* Unified directive binding object
|
|
204
204
|
*/
|
|
205
205
|
export declare interface DirectiveBinding<T = any> {
|
|
206
|
-
/**
|
|
206
|
+
/** The value passed to the directive */
|
|
207
207
|
value: T;
|
|
208
|
-
/**
|
|
208
|
+
/** The previous value */
|
|
209
209
|
oldValue: T | null;
|
|
210
|
-
/**
|
|
210
|
+
/** The directive argument (v-xxx:arg) */
|
|
211
211
|
arg?: string;
|
|
212
|
-
/**
|
|
212
|
+
/** The modifiers object (v-xxx.modifier) */
|
|
213
213
|
modifiers: Record<string, boolean>;
|
|
214
|
-
/**
|
|
214
|
+
/** The component instance */
|
|
215
215
|
instance: ComponentPublicInstance | null;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
/**
|
|
219
|
-
*
|
|
219
|
+
* Directive definition interface
|
|
220
220
|
*/
|
|
221
221
|
export declare interface DirectiveDefinition<T = any, B extends Element = Element> extends DirectiveHooks<T, B> {
|
|
222
|
-
/**
|
|
222
|
+
/** The directive name */
|
|
223
223
|
name: string;
|
|
224
|
-
/**
|
|
224
|
+
/** The Vue version compatibility */
|
|
225
225
|
version?: '2' | '3' | 'both';
|
|
226
|
-
/**
|
|
226
|
+
/** Whether SSR compatible */
|
|
227
227
|
ssr?: boolean;
|
|
228
|
-
/**
|
|
228
|
+
/** Default values */
|
|
229
229
|
defaults?: Partial<T>;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
/**
|
|
233
|
-
*
|
|
233
|
+
* Unified directive hooks
|
|
234
234
|
*/
|
|
235
235
|
export declare interface DirectiveHooks<T = any, B extends Element = Element> {
|
|
236
236
|
/**
|
|
237
|
-
*
|
|
238
|
-
* @param el
|
|
239
|
-
* @param binding
|
|
240
|
-
* @param vnode Vue
|
|
237
|
+
* Called when the directive is bound to an element
|
|
238
|
+
* @param el The bound DOM element
|
|
239
|
+
* @param binding The binding object
|
|
240
|
+
* @param vnode The Vue virtual node
|
|
241
241
|
*/
|
|
242
242
|
mounted?: (el: B, binding: DirectiveBinding<T>, vnode: VNode) => void;
|
|
243
243
|
/**
|
|
244
|
-
*
|
|
245
|
-
* @param el
|
|
246
|
-
* @param binding
|
|
247
|
-
* @param vnode
|
|
248
|
-
* @param prevBinding
|
|
249
|
-
* @param prevVnode
|
|
244
|
+
* Called when the element is updated
|
|
245
|
+
* @param el The bound DOM element
|
|
246
|
+
* @param binding The new binding object
|
|
247
|
+
* @param vnode The new virtual node
|
|
248
|
+
* @param prevBinding The previous binding object
|
|
249
|
+
* @param prevVnode The previous virtual node
|
|
250
250
|
*/
|
|
251
251
|
updated?: (el: B, binding: DirectiveBinding<T>, vnode: VNode, prevBinding: DirectiveBinding<T>, prevVnode: VNode) => void;
|
|
252
252
|
/**
|
|
253
|
-
*
|
|
254
|
-
* @param el
|
|
255
|
-
* @param binding
|
|
256
|
-
* @param vnode
|
|
253
|
+
* Called when the directive is unbound
|
|
254
|
+
* @param el The bound DOM element
|
|
255
|
+
* @param binding The binding object
|
|
256
|
+
* @param vnode The virtual node
|
|
257
257
|
*/
|
|
258
258
|
unmounted?: (el: B, binding: DirectiveBinding<T>, vnode: VNode) => void;
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
/**
|
|
262
|
-
*
|
|
262
|
+
* Directive installation options
|
|
263
263
|
*/
|
|
264
264
|
export declare interface DirectiveInstallOptions {
|
|
265
|
-
/**
|
|
265
|
+
/** List of directive names to register, registers all if not provided */
|
|
266
266
|
directives?: string[];
|
|
267
|
-
/**
|
|
267
|
+
/** Whether to register all directives */
|
|
268
268
|
all?: boolean;
|
|
269
|
-
/**
|
|
269
|
+
/** Global configuration */
|
|
270
270
|
config?: Record<string, any>;
|
|
271
271
|
}
|
|
272
272
|
|
|
273
273
|
/**
|
|
274
|
-
* Directix
|
|
274
|
+
* Directix plugin
|
|
275
275
|
*/
|
|
276
276
|
export declare const Directix: Plugin_2;
|
|
277
277
|
|
|
278
278
|
/**
|
|
279
|
-
*
|
|
279
|
+
* Directive binding value type
|
|
280
280
|
*/
|
|
281
281
|
export declare type FocusBinding = boolean | FocusOptions_2;
|
|
282
282
|
|
|
283
283
|
/**
|
|
284
|
-
*
|
|
284
|
+
* Focus directive options
|
|
285
285
|
*/
|
|
286
286
|
declare interface FocusOptions_2 {
|
|
287
287
|
/**
|
|
288
|
-
*
|
|
288
|
+
* Whether to auto focus
|
|
289
289
|
* @default true
|
|
290
290
|
*/
|
|
291
291
|
focus?: boolean;
|
|
292
292
|
/**
|
|
293
|
-
*
|
|
293
|
+
* Whether to refocus when binding value changes
|
|
294
294
|
* @default false
|
|
295
295
|
*/
|
|
296
296
|
refocus?: boolean;
|
|
297
297
|
/**
|
|
298
|
-
*
|
|
298
|
+
* Callback when focused
|
|
299
299
|
*/
|
|
300
300
|
onFocus?: (el: HTMLElement) => void;
|
|
301
301
|
/**
|
|
302
|
-
*
|
|
302
|
+
* Callback when blurred
|
|
303
303
|
*/
|
|
304
304
|
onBlur?: (el: HTMLElement) => void;
|
|
305
305
|
}
|
|
306
306
|
export { FocusOptions_2 as FocusOptions }
|
|
307
307
|
|
|
308
308
|
/**
|
|
309
|
-
*
|
|
309
|
+
* Generate unique ID
|
|
310
310
|
*/
|
|
311
311
|
export declare function generateId(prefix?: string): string;
|
|
312
312
|
|
|
313
313
|
/**
|
|
314
|
-
*
|
|
314
|
+
* Get nested property value by path
|
|
315
315
|
*/
|
|
316
316
|
export declare function get<T = any>(obj: Record<string, any>, path: string, defaultValue?: T): T;
|
|
317
317
|
|
|
318
318
|
/**
|
|
319
|
-
*
|
|
319
|
+
* Get current Vue version
|
|
320
320
|
*/
|
|
321
321
|
export declare function getVueVersion(): 2 | 3;
|
|
322
322
|
|
|
323
323
|
/**
|
|
324
|
-
*
|
|
324
|
+
* Check if value is an array
|
|
325
325
|
*/
|
|
326
326
|
export declare function isArray(value: unknown): value is any[];
|
|
327
327
|
|
|
328
328
|
/**
|
|
329
|
-
*
|
|
329
|
+
* Check if value is a boolean
|
|
330
330
|
*/
|
|
331
331
|
export declare function isBoolean(value: unknown): value is boolean;
|
|
332
332
|
|
|
333
333
|
/**
|
|
334
|
-
*
|
|
334
|
+
* Check if browser environment
|
|
335
335
|
*/
|
|
336
336
|
export declare const isBrowser: () => boolean;
|
|
337
337
|
|
|
338
338
|
/**
|
|
339
|
-
*
|
|
339
|
+
* Check if value is empty
|
|
340
340
|
*/
|
|
341
341
|
export declare function isEmpty(value: unknown): boolean;
|
|
342
342
|
|
|
343
343
|
/**
|
|
344
|
-
*
|
|
344
|
+
* Check if value is a function
|
|
345
345
|
*/
|
|
346
346
|
export declare function isFunction(value: unknown): value is (...args: any[]) => any;
|
|
347
347
|
|
|
348
348
|
/**
|
|
349
|
-
*
|
|
349
|
+
* Check if value is a number
|
|
350
350
|
*/
|
|
351
351
|
export declare function isNumber(value: unknown): value is number;
|
|
352
352
|
|
|
353
353
|
/**
|
|
354
|
-
*
|
|
354
|
+
* Check if value is an object
|
|
355
355
|
*/
|
|
356
356
|
export declare function isObject(value: unknown): value is Record<string, any>;
|
|
357
357
|
|
|
358
358
|
/**
|
|
359
|
-
*
|
|
359
|
+
* Check if value is a Promise
|
|
360
360
|
*/
|
|
361
361
|
export declare function isPromise<T = any>(value: unknown): value is Promise<T>;
|
|
362
362
|
|
|
363
363
|
/**
|
|
364
|
-
*
|
|
364
|
+
* Check if server-side rendering
|
|
365
365
|
*/
|
|
366
366
|
export declare const isSSR: () => boolean;
|
|
367
367
|
|
|
368
368
|
/**
|
|
369
|
-
*
|
|
369
|
+
* Check if value is a string
|
|
370
370
|
*/
|
|
371
371
|
export declare function isString(value: unknown): value is string;
|
|
372
372
|
|
|
373
373
|
/**
|
|
374
|
-
*
|
|
374
|
+
* Check if Vue 2
|
|
375
375
|
*/
|
|
376
376
|
export declare const isVue2: () => boolean;
|
|
377
377
|
|
|
378
378
|
/**
|
|
379
|
-
*
|
|
379
|
+
* Check if Vue 3
|
|
380
380
|
*/
|
|
381
381
|
export declare const isVue3: () => boolean;
|
|
382
382
|
|
|
383
383
|
/**
|
|
384
|
-
*
|
|
385
|
-
*
|
|
384
|
+
* Parse time argument
|
|
385
|
+
* Supports formats: "300" | "300ms" | "1s"
|
|
386
386
|
*/
|
|
387
387
|
export declare function parseTime(arg?: string): number | null;
|
|
388
388
|
|
|
389
389
|
/**
|
|
390
|
-
*
|
|
390
|
+
* Set nested property value by path
|
|
391
391
|
*/
|
|
392
392
|
export declare function set(obj: Record<string, any>, path: string, value: any): void;
|
|
393
393
|
|
|
394
394
|
/**
|
|
395
|
-
*
|
|
395
|
+
* Check if Clipboard API is supported
|
|
396
396
|
*/
|
|
397
397
|
export declare const supportsClipboard: () => boolean;
|
|
398
398
|
|
|
399
399
|
/**
|
|
400
|
-
*
|
|
400
|
+
* Check if IntersectionObserver is supported
|
|
401
401
|
*/
|
|
402
402
|
export declare const supportsIntersectionObserver: () => boolean;
|
|
403
403
|
|
|
404
404
|
/**
|
|
405
|
-
*
|
|
405
|
+
* Check if MutationObserver is supported
|
|
406
406
|
*/
|
|
407
407
|
export declare const supportsMutationObserver: () => boolean;
|
|
408
408
|
|
|
409
409
|
/**
|
|
410
|
-
*
|
|
410
|
+
* Check if passive event listening is supported
|
|
411
411
|
*/
|
|
412
412
|
export declare const supportsPassive: () => boolean;
|
|
413
413
|
|
|
414
414
|
/**
|
|
415
|
-
*
|
|
415
|
+
* Check if ResizeObserver is supported
|
|
416
416
|
*/
|
|
417
417
|
export declare const supportsResizeObserver: () => boolean;
|
|
418
418
|
|
|
419
419
|
/**
|
|
420
|
-
*
|
|
420
|
+
* Directive binding value type
|
|
421
421
|
*/
|
|
422
422
|
export declare type ThrottleBinding<T extends (...args: any[]) => any = any> = T | ThrottleOptions<T>;
|
|
423
423
|
|
|
424
424
|
/**
|
|
425
|
-
*
|
|
425
|
+
* Throttled function type
|
|
426
426
|
*/
|
|
427
427
|
export declare interface ThrottledFunction<T extends (...args: any[]) => any> {
|
|
428
428
|
(...args: Parameters<T>): void;
|
|
@@ -430,7 +430,7 @@ export declare interface ThrottledFunction<T extends (...args: any[]) => any> {
|
|
|
430
430
|
}
|
|
431
431
|
|
|
432
432
|
/**
|
|
433
|
-
*
|
|
433
|
+
* Throttle function
|
|
434
434
|
*/
|
|
435
435
|
export declare function throttleFn<T extends (...args: any[]) => any>(func: T, wait?: number, options?: {
|
|
436
436
|
leading?: boolean;
|
|
@@ -440,38 +440,38 @@ export declare function throttleFn<T extends (...args: any[]) => any>(func: T, w
|
|
|
440
440
|
};
|
|
441
441
|
|
|
442
442
|
/**
|
|
443
|
-
*
|
|
443
|
+
* Throttle directive options
|
|
444
444
|
*/
|
|
445
445
|
export declare interface ThrottleOptions<T extends (...args: any[]) => any = any> {
|
|
446
446
|
/**
|
|
447
|
-
*
|
|
447
|
+
* Function to throttle
|
|
448
448
|
*/
|
|
449
449
|
handler: T;
|
|
450
450
|
/**
|
|
451
|
-
*
|
|
451
|
+
* Delay time in milliseconds
|
|
452
452
|
* @default 300
|
|
453
453
|
*/
|
|
454
454
|
wait?: number;
|
|
455
455
|
/**
|
|
456
|
-
*
|
|
456
|
+
* Whether to invoke immediately before delay starts
|
|
457
457
|
* @default true
|
|
458
458
|
*/
|
|
459
459
|
leading?: boolean;
|
|
460
460
|
/**
|
|
461
|
-
*
|
|
461
|
+
* Whether to invoke after delay ends
|
|
462
462
|
* @default true
|
|
463
463
|
*/
|
|
464
464
|
trailing?: boolean;
|
|
465
465
|
}
|
|
466
466
|
|
|
467
467
|
/**
|
|
468
|
-
* v-click-outside
|
|
468
|
+
* v-click-outside directive
|
|
469
469
|
*
|
|
470
470
|
* @example
|
|
471
471
|
* ```vue
|
|
472
472
|
* <template>
|
|
473
473
|
* <div v-click-outside="handleClickOutside">
|
|
474
|
-
*
|
|
474
|
+
* Dropdown menu
|
|
475
475
|
* </div>
|
|
476
476
|
* </template>
|
|
477
477
|
* ```
|
|
@@ -481,12 +481,12 @@ export { vClickOutside as clickOutside }
|
|
|
481
481
|
export { vClickOutside }
|
|
482
482
|
|
|
483
483
|
/**
|
|
484
|
-
* v-copy
|
|
484
|
+
* v-copy directive
|
|
485
485
|
*
|
|
486
486
|
* @example
|
|
487
487
|
* ```vue
|
|
488
488
|
* <template>
|
|
489
|
-
* <button v-copy="textToCopy"
|
|
489
|
+
* <button v-copy="textToCopy">Copy Text</button>
|
|
490
490
|
* </template>
|
|
491
491
|
* ```
|
|
492
492
|
*/
|
|
@@ -495,7 +495,7 @@ export { vCopy as copy }
|
|
|
495
495
|
export { vCopy }
|
|
496
496
|
|
|
497
497
|
/**
|
|
498
|
-
* v-debounce
|
|
498
|
+
* v-debounce directive
|
|
499
499
|
*
|
|
500
500
|
* @example
|
|
501
501
|
* ```vue
|
|
@@ -503,8 +503,8 @@ export { vCopy }
|
|
|
503
503
|
* <input v-debounce="handleInput" />
|
|
504
504
|
* <input v-debounce:500ms="handleInput" />
|
|
505
505
|
* <input v-debounce="{ handler: handleInput, wait: 500 }" />
|
|
506
|
-
* <div v-debounce.scroll="handleScroll"
|
|
507
|
-
* <div v-debounce:100.scroll="handleScroll">100ms
|
|
506
|
+
* <div v-debounce.scroll="handleScroll">Scroll Debounce</div>
|
|
507
|
+
* <div v-debounce:100.scroll="handleScroll">100ms Scroll Debounce</div>
|
|
508
508
|
* </template>
|
|
509
509
|
* ```
|
|
510
510
|
*/
|
|
@@ -513,7 +513,7 @@ export { vDebounce as debounce }
|
|
|
513
513
|
export { vDebounce }
|
|
514
514
|
|
|
515
515
|
/**
|
|
516
|
-
* v-focus
|
|
516
|
+
* v-focus directive
|
|
517
517
|
*
|
|
518
518
|
* @example
|
|
519
519
|
* ```vue
|
|
@@ -528,15 +528,15 @@ export { vFocus as focus }
|
|
|
528
528
|
export { vFocus }
|
|
529
529
|
|
|
530
530
|
/**
|
|
531
|
-
* v-throttle
|
|
531
|
+
* v-throttle directive
|
|
532
532
|
*
|
|
533
533
|
* @example
|
|
534
534
|
* ```vue
|
|
535
535
|
* <template>
|
|
536
|
-
* <button v-throttle="handleClick"
|
|
537
|
-
* <button v-throttle:1s="handleClick">
|
|
538
|
-
* <div v-throttle.scroll="handleScroll"
|
|
539
|
-
* <div v-throttle:100.scroll="handleScroll">100ms
|
|
536
|
+
* <button v-throttle="handleClick">Throttled Button</button>
|
|
537
|
+
* <button v-throttle:1s="handleClick">1s Throttled</button>
|
|
538
|
+
* <div v-throttle.scroll="handleScroll">Scroll Throttle</div>
|
|
539
|
+
* <div v-throttle:100.scroll="handleScroll">100ms Scroll Throttle</div>
|
|
540
540
|
* </template>
|
|
541
541
|
* ```
|
|
542
542
|
*/
|
|
@@ -545,7 +545,7 @@ export { vThrottle as throttle }
|
|
|
545
545
|
export { vThrottle }
|
|
546
546
|
|
|
547
547
|
/**
|
|
548
|
-
* Vue 2
|
|
548
|
+
* Vue 2 directive hooks
|
|
549
549
|
*/
|
|
550
550
|
export declare interface Vue2DirectiveHooks {
|
|
551
551
|
bind?: (el: any, binding: any, vnode: any, oldVnode: any) => void;
|
|
@@ -556,7 +556,7 @@ export declare interface Vue2DirectiveHooks {
|
|
|
556
556
|
}
|
|
557
557
|
|
|
558
558
|
/**
|
|
559
|
-
* Vue 3
|
|
559
|
+
* Vue 3 directive hooks
|
|
560
560
|
*/
|
|
561
561
|
export declare interface Vue3DirectiveHooks {
|
|
562
562
|
created?: (el: any, binding: any, vnode: any, prevVnode: any) => void;
|