directix 1.0.0-alpha.0 → 1.0.0-beta.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/LICENSE +21 -0
- package/README.md +212 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +571 -0
- package/dist/index.esm.js +1015 -0
- package/dist/index.esm.js.map +1 -0
- package/package.json +94 -18
- package/index.js +0 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,571 @@
|
|
|
1
|
+
import { ComponentPublicInstance } from 'vue';
|
|
2
|
+
import { Directive } from 'vue';
|
|
3
|
+
import { Plugin as Plugin_2 } from 'vue';
|
|
4
|
+
import { VNode } from 'vue';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 添加清理函数到元素
|
|
8
|
+
*/
|
|
9
|
+
export declare function addCleanupVue2(el: Element, fn: () => void): void;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 添加清理函数到元素
|
|
13
|
+
*/
|
|
14
|
+
export declare function addCleanupVue3(el: Element, fn: () => void): void;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 指令绑定值类型
|
|
18
|
+
*/
|
|
19
|
+
export declare type ClickOutsideBinding = ClickOutsideHandler | ClickOutsideOptions;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 点击外部处理函数
|
|
23
|
+
*/
|
|
24
|
+
export declare type ClickOutsideHandler = (event: MouseEvent | TouchEvent) => void;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 点击外部指令选项
|
|
28
|
+
*/
|
|
29
|
+
export declare interface ClickOutsideOptions {
|
|
30
|
+
/**
|
|
31
|
+
* 点击外部时的回调函数
|
|
32
|
+
* @required
|
|
33
|
+
*/
|
|
34
|
+
handler: ClickOutsideHandler;
|
|
35
|
+
/**
|
|
36
|
+
* 排除的元素选择器或元素引用
|
|
37
|
+
*/
|
|
38
|
+
exclude?: (string | HTMLElement | (() => HTMLElement | null))[];
|
|
39
|
+
/**
|
|
40
|
+
* 是否使用捕获模式
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
43
|
+
capture?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* 监听的事件类型
|
|
46
|
+
* @default ['click']
|
|
47
|
+
*/
|
|
48
|
+
events?: ('click' | 'mousedown' | 'mouseup' | 'touchstart' | 'touchend')[];
|
|
49
|
+
/**
|
|
50
|
+
* 是否禁用
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* 停止传播
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
stop?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* 阻止默认行为
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
prevent?: boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* 指令绑定值类型
|
|
68
|
+
*/
|
|
69
|
+
export declare type CopyBinding = string | CopyOptions;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 复制失败回调
|
|
73
|
+
*/
|
|
74
|
+
export declare type CopyErrorCallback = (error: Error) => void;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 复制指令选项
|
|
78
|
+
*/
|
|
79
|
+
export declare interface CopyOptions {
|
|
80
|
+
/**
|
|
81
|
+
* 要复制的文本
|
|
82
|
+
* @required
|
|
83
|
+
*/
|
|
84
|
+
value: string;
|
|
85
|
+
/**
|
|
86
|
+
* 复制成功回调
|
|
87
|
+
*/
|
|
88
|
+
onSuccess?: CopySuccessCallback;
|
|
89
|
+
/**
|
|
90
|
+
* 复制失败回调
|
|
91
|
+
*/
|
|
92
|
+
onError?: CopyErrorCallback;
|
|
93
|
+
/**
|
|
94
|
+
* 复制按钮的提示文本
|
|
95
|
+
*/
|
|
96
|
+
title?: string;
|
|
97
|
+
/**
|
|
98
|
+
* 是否禁用
|
|
99
|
+
* @default false
|
|
100
|
+
*/
|
|
101
|
+
disabled?: boolean;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* 复制成功回调
|
|
106
|
+
*/
|
|
107
|
+
export declare type CopySuccessCallback = (text: string) => void;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Vue 2 指令适配器
|
|
111
|
+
* @returns Vue 2 directive object with bind/inserted/update/unbind hooks
|
|
112
|
+
*/
|
|
113
|
+
export declare function createVue2Directive<T, B extends Element>(hooks: DirectiveHooks<T, B>): Record<string, any>;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Vue 3 指令适配器
|
|
117
|
+
* @returns Vue 3 directive object with created/mounted/updated/unmounted hooks
|
|
118
|
+
*/
|
|
119
|
+
export declare function createVue3Directive<T, B extends Element>(hooks: DirectiveHooks<T, B>): Record<string, any>;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* 跨版本指令类型(兼容 Vue 2/3)
|
|
123
|
+
*/
|
|
124
|
+
export declare type CrossVersionDirective = Directive | Vue2DirectiveHooks | Vue3DirectiveHooks;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* 指令绑定值类型
|
|
128
|
+
*/
|
|
129
|
+
export declare type DebounceBinding<T extends (...args: any[]) => any = any> = T | DebounceOptions<T>;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* 防抖函数类型
|
|
133
|
+
*/
|
|
134
|
+
export declare interface DebouncedFunction<T extends (...args: any[]) => any> {
|
|
135
|
+
(...args: Parameters<T>): void;
|
|
136
|
+
cancel: () => void;
|
|
137
|
+
flush: () => void;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* 防抖函数
|
|
142
|
+
*/
|
|
143
|
+
export declare function debounceFn<T extends (...args: any[]) => any>(func: T, wait?: number, options?: {
|
|
144
|
+
leading?: boolean;
|
|
145
|
+
trailing?: boolean;
|
|
146
|
+
}): ((...args: Parameters<T>) => void) & {
|
|
147
|
+
cancel: () => void;
|
|
148
|
+
flush: () => void;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* 防抖指令选项
|
|
153
|
+
*/
|
|
154
|
+
export declare interface DebounceOptions<T extends (...args: any[]) => any = any> {
|
|
155
|
+
/**
|
|
156
|
+
* 要防抖的函数
|
|
157
|
+
*/
|
|
158
|
+
handler: T;
|
|
159
|
+
/**
|
|
160
|
+
* 延迟时间(毫秒)
|
|
161
|
+
* @default 300
|
|
162
|
+
*/
|
|
163
|
+
wait?: number;
|
|
164
|
+
/**
|
|
165
|
+
* 是否在延迟开始前立即调用
|
|
166
|
+
* @default false
|
|
167
|
+
*/
|
|
168
|
+
leading?: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* 是否在延迟结束后调用
|
|
171
|
+
* @default true
|
|
172
|
+
*/
|
|
173
|
+
trailing?: boolean;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* 深拷贝
|
|
178
|
+
*/
|
|
179
|
+
export declare function deepClone<T>(obj: T): T;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* 深合并
|
|
183
|
+
*/
|
|
184
|
+
export declare function deepMerge<T extends Record<string, any>>(target: T, ...sources: Partial<T>[]): T;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* 定义一个跨版本兼容的指令
|
|
188
|
+
* @param definition 指令定义
|
|
189
|
+
* @returns Vue 指令对象
|
|
190
|
+
*/
|
|
191
|
+
export declare function defineDirective<T = any, B extends Element = Element>(definition: DirectiveDefinition<T, B>): Directive;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* 定义指令组
|
|
195
|
+
*/
|
|
196
|
+
export declare function defineDirectiveGroup(name: string, directives: Record<string, any>): {
|
|
197
|
+
name: string;
|
|
198
|
+
directives: Record<string, any>;
|
|
199
|
+
install: (app: any) => void;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* 统一的指令绑定对象
|
|
204
|
+
*/
|
|
205
|
+
export declare interface DirectiveBinding<T = any> {
|
|
206
|
+
/** 指令绑定的值 */
|
|
207
|
+
value: T;
|
|
208
|
+
/** 上一次绑定的值 */
|
|
209
|
+
oldValue: T | null;
|
|
210
|
+
/** 指令参数 (v-xxx:arg) */
|
|
211
|
+
arg?: string;
|
|
212
|
+
/** 修饰符对象 (v-xxx.modifier) */
|
|
213
|
+
modifiers: Record<string, boolean>;
|
|
214
|
+
/** 组件实例 */
|
|
215
|
+
instance: ComponentPublicInstance | null;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* 指令定义接口
|
|
220
|
+
*/
|
|
221
|
+
export declare interface DirectiveDefinition<T = any, B extends Element = Element> extends DirectiveHooks<T, B> {
|
|
222
|
+
/** 指令名称 */
|
|
223
|
+
name: string;
|
|
224
|
+
/** 指令版本 */
|
|
225
|
+
version?: '2' | '3' | 'both';
|
|
226
|
+
/** 是否服务端渲染兼容 */
|
|
227
|
+
ssr?: boolean;
|
|
228
|
+
/** 默认值 */
|
|
229
|
+
defaults?: Partial<T>;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* 统一的指令钩子函数
|
|
234
|
+
*/
|
|
235
|
+
export declare interface DirectiveHooks<T = any, B extends Element = Element> {
|
|
236
|
+
/**
|
|
237
|
+
* 指令绑定到元素时调用
|
|
238
|
+
* @param el 绑定的 DOM 元素
|
|
239
|
+
* @param binding 绑定对象
|
|
240
|
+
* @param vnode Vue 虚拟节点
|
|
241
|
+
*/
|
|
242
|
+
mounted?: (el: B, binding: DirectiveBinding<T>, vnode: VNode) => void;
|
|
243
|
+
/**
|
|
244
|
+
* 元素更新时调用
|
|
245
|
+
* @param el 绑定的 DOM 元素
|
|
246
|
+
* @param binding 新的绑定对象
|
|
247
|
+
* @param vnode 新的虚拟节点
|
|
248
|
+
* @param prevBinding 旧的绑定对象
|
|
249
|
+
* @param prevVnode 旧的虚拟节点
|
|
250
|
+
*/
|
|
251
|
+
updated?: (el: B, binding: DirectiveBinding<T>, vnode: VNode, prevBinding: DirectiveBinding<T>, prevVnode: VNode) => void;
|
|
252
|
+
/**
|
|
253
|
+
* 指令卸载时调用
|
|
254
|
+
* @param el 绑定的 DOM 元素
|
|
255
|
+
* @param binding 绑定对象
|
|
256
|
+
* @param vnode 虚拟节点
|
|
257
|
+
*/
|
|
258
|
+
unmounted?: (el: B, binding: DirectiveBinding<T>, vnode: VNode) => void;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* 指令安装选项
|
|
263
|
+
*/
|
|
264
|
+
export declare interface DirectiveInstallOptions {
|
|
265
|
+
/** 注册的指令名称列表,不传则注册全部 */
|
|
266
|
+
directives?: string[];
|
|
267
|
+
/** 是否注册全部指令 */
|
|
268
|
+
all?: boolean;
|
|
269
|
+
/** 全局配置 */
|
|
270
|
+
config?: Record<string, any>;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Directix 插件
|
|
275
|
+
*/
|
|
276
|
+
export declare const Directix: Plugin_2;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* 指令绑定值类型
|
|
280
|
+
*/
|
|
281
|
+
export declare type FocusBinding = boolean | FocusOptions_2;
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* 焦点指令选项
|
|
285
|
+
*/
|
|
286
|
+
declare interface FocusOptions_2 {
|
|
287
|
+
/**
|
|
288
|
+
* 是否自动聚焦
|
|
289
|
+
* @default true
|
|
290
|
+
*/
|
|
291
|
+
focus?: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* 是否在每次更新时重新聚焦
|
|
294
|
+
* @default false
|
|
295
|
+
*/
|
|
296
|
+
refocus?: boolean;
|
|
297
|
+
/**
|
|
298
|
+
* 聚焦时的回调
|
|
299
|
+
*/
|
|
300
|
+
onFocus?: (el: HTMLElement) => void;
|
|
301
|
+
/**
|
|
302
|
+
* 失焦时的回调
|
|
303
|
+
*/
|
|
304
|
+
onBlur?: (el: HTMLElement) => void;
|
|
305
|
+
}
|
|
306
|
+
export { FocusOptions_2 as FocusOptions }
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* 生成唯一 ID
|
|
310
|
+
*/
|
|
311
|
+
export declare function generateId(prefix?: string): string;
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* 获取嵌套属性值
|
|
315
|
+
*/
|
|
316
|
+
export declare function get<T = any>(obj: Record<string, any>, path: string, defaultValue?: T): T;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* 获取当前 Vue 版本
|
|
320
|
+
*/
|
|
321
|
+
export declare function getVueVersion(): 2 | 3;
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* 检查是否为数组
|
|
325
|
+
*/
|
|
326
|
+
export declare function isArray(value: unknown): value is any[];
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* 检查是否为布尔值
|
|
330
|
+
*/
|
|
331
|
+
export declare function isBoolean(value: unknown): value is boolean;
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* 是否浏览器环境
|
|
335
|
+
*/
|
|
336
|
+
export declare const isBrowser: () => boolean;
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* 检查是否为空
|
|
340
|
+
*/
|
|
341
|
+
export declare function isEmpty(value: unknown): boolean;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* 检查是否为函数
|
|
345
|
+
*/
|
|
346
|
+
export declare function isFunction(value: unknown): value is (...args: any[]) => any;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* 检查是否为数字
|
|
350
|
+
*/
|
|
351
|
+
export declare function isNumber(value: unknown): value is number;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* 检查是否为对象
|
|
355
|
+
*/
|
|
356
|
+
export declare function isObject(value: unknown): value is Record<string, any>;
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* 检查是否为 Promise
|
|
360
|
+
*/
|
|
361
|
+
export declare function isPromise<T = any>(value: unknown): value is Promise<T>;
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* 是否服务端渲染
|
|
365
|
+
*/
|
|
366
|
+
export declare const isSSR: () => boolean;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* 检查是否为字符串
|
|
370
|
+
*/
|
|
371
|
+
export declare function isString(value: unknown): value is string;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* 是否 Vue 2
|
|
375
|
+
*/
|
|
376
|
+
export declare const isVue2: () => boolean;
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* 是否 Vue 3
|
|
380
|
+
*/
|
|
381
|
+
export declare const isVue3: () => boolean;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* 解析时间参数
|
|
385
|
+
* 支持格式: "300" | "300ms" | "1s"
|
|
386
|
+
*/
|
|
387
|
+
export declare function parseTime(arg?: string): number | null;
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* 设置嵌套属性值
|
|
391
|
+
*/
|
|
392
|
+
export declare function set(obj: Record<string, any>, path: string, value: any): void;
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* 是否支持 Clipboard API
|
|
396
|
+
*/
|
|
397
|
+
export declare const supportsClipboard: () => boolean;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* 是否支持 IntersectionObserver
|
|
401
|
+
*/
|
|
402
|
+
export declare const supportsIntersectionObserver: () => boolean;
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* 是否支持 MutationObserver
|
|
406
|
+
*/
|
|
407
|
+
export declare const supportsMutationObserver: () => boolean;
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* 是否支持 Passive 事件监听
|
|
411
|
+
*/
|
|
412
|
+
export declare const supportsPassive: () => boolean;
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* 是否支持 ResizeObserver
|
|
416
|
+
*/
|
|
417
|
+
export declare const supportsResizeObserver: () => boolean;
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* 指令绑定值类型
|
|
421
|
+
*/
|
|
422
|
+
export declare type ThrottleBinding<T extends (...args: any[]) => any = any> = T | ThrottleOptions<T>;
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* 节流函数类型
|
|
426
|
+
*/
|
|
427
|
+
export declare interface ThrottledFunction<T extends (...args: any[]) => any> {
|
|
428
|
+
(...args: Parameters<T>): void;
|
|
429
|
+
cancel: () => void;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* 节流函数
|
|
434
|
+
*/
|
|
435
|
+
export declare function throttleFn<T extends (...args: any[]) => any>(func: T, wait?: number, options?: {
|
|
436
|
+
leading?: boolean;
|
|
437
|
+
trailing?: boolean;
|
|
438
|
+
}): ((...args: Parameters<T>) => void) & {
|
|
439
|
+
cancel: () => void;
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* 节流指令选项
|
|
444
|
+
*/
|
|
445
|
+
export declare interface ThrottleOptions<T extends (...args: any[]) => any = any> {
|
|
446
|
+
/**
|
|
447
|
+
* 要节流的函数
|
|
448
|
+
*/
|
|
449
|
+
handler: T;
|
|
450
|
+
/**
|
|
451
|
+
* 延迟时间(毫秒)
|
|
452
|
+
* @default 300
|
|
453
|
+
*/
|
|
454
|
+
wait?: number;
|
|
455
|
+
/**
|
|
456
|
+
* 是否在延迟开始前立即调用
|
|
457
|
+
* @default true
|
|
458
|
+
*/
|
|
459
|
+
leading?: boolean;
|
|
460
|
+
/**
|
|
461
|
+
* 是否在延迟结束后调用
|
|
462
|
+
* @default true
|
|
463
|
+
*/
|
|
464
|
+
trailing?: boolean;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* v-click-outside 指令
|
|
469
|
+
*
|
|
470
|
+
* @example
|
|
471
|
+
* ```vue
|
|
472
|
+
* <template>
|
|
473
|
+
* <div v-click-outside="handleClickOutside">
|
|
474
|
+
* 下拉菜单
|
|
475
|
+
* </div>
|
|
476
|
+
* </template>
|
|
477
|
+
* ```
|
|
478
|
+
*/
|
|
479
|
+
declare const vClickOutside: Directive;
|
|
480
|
+
export { vClickOutside as clickOutside }
|
|
481
|
+
export { vClickOutside }
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* v-copy 指令
|
|
485
|
+
*
|
|
486
|
+
* @example
|
|
487
|
+
* ```vue
|
|
488
|
+
* <template>
|
|
489
|
+
* <button v-copy="textToCopy">复制文本</button>
|
|
490
|
+
* </template>
|
|
491
|
+
* ```
|
|
492
|
+
*/
|
|
493
|
+
declare const vCopy: Directive;
|
|
494
|
+
export { vCopy as copy }
|
|
495
|
+
export { vCopy }
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* v-debounce 指令
|
|
499
|
+
*
|
|
500
|
+
* @example
|
|
501
|
+
* ```vue
|
|
502
|
+
* <template>
|
|
503
|
+
* <input v-debounce="handleInput" />
|
|
504
|
+
* <input v-debounce:500ms="handleInput" />
|
|
505
|
+
* <input v-debounce="{ handler: handleInput, wait: 500 }" />
|
|
506
|
+
* <div v-debounce.scroll="handleScroll">滚动防抖</div>
|
|
507
|
+
* <div v-debounce:100.scroll="handleScroll">100ms 滚动防抖</div>
|
|
508
|
+
* </template>
|
|
509
|
+
* ```
|
|
510
|
+
*/
|
|
511
|
+
declare const vDebounce: Directive;
|
|
512
|
+
export { vDebounce as debounce }
|
|
513
|
+
export { vDebounce }
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* v-focus 指令
|
|
517
|
+
*
|
|
518
|
+
* @example
|
|
519
|
+
* ```vue
|
|
520
|
+
* <template>
|
|
521
|
+
* <input v-focus />
|
|
522
|
+
* <input v-focus="{ focus: true, refocus: true }" />
|
|
523
|
+
* </template>
|
|
524
|
+
* ```
|
|
525
|
+
*/
|
|
526
|
+
declare const vFocus: Directive;
|
|
527
|
+
export { vFocus as focus }
|
|
528
|
+
export { vFocus }
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* v-throttle 指令
|
|
532
|
+
*
|
|
533
|
+
* @example
|
|
534
|
+
* ```vue
|
|
535
|
+
* <template>
|
|
536
|
+
* <button v-throttle="handleClick">节流按钮</button>
|
|
537
|
+
* <button v-throttle:1s="handleClick">1秒节流</button>
|
|
538
|
+
* <div v-throttle.scroll="handleScroll">滚动节流</div>
|
|
539
|
+
* <div v-throttle:100.scroll="handleScroll">100ms 滚动节流</div>
|
|
540
|
+
* </template>
|
|
541
|
+
* ```
|
|
542
|
+
*/
|
|
543
|
+
declare const vThrottle: Directive;
|
|
544
|
+
export { vThrottle as throttle }
|
|
545
|
+
export { vThrottle }
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Vue 2 指令钩子
|
|
549
|
+
*/
|
|
550
|
+
export declare interface Vue2DirectiveHooks {
|
|
551
|
+
bind?: (el: any, binding: any, vnode: any, oldVnode: any) => void;
|
|
552
|
+
inserted?: (el: any, binding: any, vnode: any, oldVnode: any) => void;
|
|
553
|
+
update?: (el: any, binding: any, vnode: any, oldVnode: any) => void;
|
|
554
|
+
componentUpdated?: (el: any, binding: any, vnode: any, oldVnode: any) => void;
|
|
555
|
+
unbind?: (el: any, binding: any, vnode: any, oldVnode: any) => void;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Vue 3 指令钩子
|
|
560
|
+
*/
|
|
561
|
+
export declare interface Vue3DirectiveHooks {
|
|
562
|
+
created?: (el: any, binding: any, vnode: any, prevVnode: any) => void;
|
|
563
|
+
beforeMount?: (el: any, binding: any, vnode: any, prevVnode: any) => void;
|
|
564
|
+
mounted?: (el: any, binding: any, vnode: any, prevVnode: any) => void;
|
|
565
|
+
beforeUpdate?: (el: any, binding: any, vnode: any, prevVnode: any) => void;
|
|
566
|
+
updated?: (el: any, binding: any, vnode: any, prevVnode: any) => void;
|
|
567
|
+
beforeUnmount?: (el: any, binding: any, vnode: any, prevVnode: any) => void;
|
|
568
|
+
unmounted?: (el: any, binding: any, vnode: any, prevVnode: any) => void;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
export { }
|