import { DirectiveBinding } from 'vue'

export default {
  mounted(el: HTMLElement, binding: DirectiveBinding) {
    if (binding.value === true) {
      const inputDom =
        (el.querySelector('.arco-input') as HTMLElement) ||
        (el.querySelector('.arco-picker-start-time') as HTMLElement) ||
        (el.querySelector('.arco-select-view-input') as HTMLElement) ||
        (el.querySelector('.arco-textarea') as HTMLElement)

      inputDom?.focus()
    }
  }
}
