import type { Directive, DirectiveBinding } from 'vue';

/**
 * 自定义指令，用于在元素挂载后自动获取焦点
 */
export const vFocus: Directive = {
  mounted(el: HTMLInputElement, binding: DirectiveBinding<any, string>) {
    const value = binding.value;
    value && el.focus();
  }
};
