koel/resources/assets/js/directives/focus.ts
2022-04-15 16:24:30 +02:00

8 lines
198 B
TypeScript

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()
}