2025-11-20 09:10:35 +08:00
|
|
|
|
import type { App } from 'vue';
|
|
|
|
|
|
import { authDirective } from '/@/utils/authDirective';
|
|
|
|
|
|
import { wavesDirective, dragDirective } from '/@/utils/customDirective';
|
2026-04-20 10:20:45 +08:00
|
|
|
|
import { debounceDirective } from '/@/directives/debounce';
|
2025-11-20 09:10:35 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 导出指令方法:v-xxx
|
|
|
|
|
|
* @methods authDirective 用户权限指令,用法:v-auth
|
|
|
|
|
|
* @methods wavesDirective 按钮波浪指令,用法:v-waves
|
|
|
|
|
|
* @methods dragDirective 自定义拖动指令,用法:v-drag
|
2026-04-20 10:20:45 +08:00
|
|
|
|
* @methods debounceDirective 防抖指令,用法:v-debounce
|
2025-11-20 09:10:35 +08:00
|
|
|
|
*/
|
|
|
|
|
|
export function directive(app: App) {
|
|
|
|
|
|
// 用户权限指令
|
|
|
|
|
|
authDirective(app);
|
|
|
|
|
|
// 按钮波浪指令
|
|
|
|
|
|
wavesDirective(app);
|
|
|
|
|
|
// 自定义拖动指令
|
|
|
|
|
|
dragDirective(app);
|
2026-04-20 10:20:45 +08:00
|
|
|
|
// 防抖指令
|
|
|
|
|
|
app.directive('debounce', debounceDirective);
|
2025-11-20 09:10:35 +08:00
|
|
|
|
}
|