use-focus-input.js 243 B

123456789101112
  1. import { ref } from 'vue'
  2. export const useFocusInput = () => {
  3. const isFocus = ref(false)
  4. const onFocus = (e) => {
  5. isFocus.value = true
  6. }
  7. const onBlur = (e) => {
  8. isFocus.value = false
  9. }
  10. return [isFocus, onFocus, onBlur]
  11. }