element-plus/packages/hooks/use-focus/index.ts
bastarder e4bb9daf4f
fix(select): Fix select.focus is undefined bug (#862)
* fix(select): Fix select.focus is undefined bug

* fix(select): Add hook test

Co-authored-by: bastarder <jie.qian@blockheaders.com>
2020-12-07 11:29:08 +08:00

10 lines
139 B
TypeScript

import { Ref } from 'vue'
export default (el: Ref<HTMLElement>) => {
return {
focus: () => {
el.value?.focus?.()
},
}
}