mirror of
https://github.com/koel/koel
synced 2024-12-22 02:23:14 +00:00
14 lines
241 B
JavaScript
14 lines
241 B
JavaScript
import Vue from 'vue';
|
|
|
|
/**
|
|
* A simple directive to set focus into an input field when it's shown.
|
|
*/
|
|
export default function (value) {
|
|
if (!value) {
|
|
return;
|
|
}
|
|
|
|
let el = this.el;
|
|
|
|
Vue.nextTick(() => el.focus());
|
|
};
|