index.ts 180 B

12345678910111213
  1. import type { Ref } from 'vue'
  2. export const useFocus = (
  3. el: Ref<{
  4. focus: () => void
  5. } | null>
  6. ) => {
  7. return {
  8. focus: () => {
  9. el.value?.focus?.()
  10. },
  11. }
  12. }