types: 优化自定义指令的类型提示 (#1161)

This commit is contained in:
sea
2024-06-06 16:26:32 +08:00
committed by GitHub
parent 33a89834d7
commit a75cf8394e
8 changed files with 69 additions and 18 deletions

View File

@@ -3,7 +3,7 @@ import type { Directive, DirectiveBinding } from "vue";
import { subBefore, subAfter, isFunction } from "@pureadmin/utils";
export const longpress: Directive = {
mounted(el: HTMLElement, binding: DirectiveBinding) {
mounted(el: HTMLElement, binding: DirectiveBinding<Function>) {
const cb = binding.value;
if (cb && isFunction(cb)) {
let timer = null;