koel/resources/assets/js/directives/focus.ts

9 lines
198 B
TypeScript
Raw Normal View History

2022-04-15 14:24:30 +00:00
import { Directive } from 'vue'
/**
* A simple directive to set focus into an input field when it's shown.
*/
export const focus: Directive = {
mounted: (el: HTMLElement): void => el.focus()
}