18 lines
594 B
JavaScript
18 lines
594 B
JavaScript
import { getCurrentInstance } from 'vue';
|
|
|
|
export default {
|
|
mounted: function () {
|
|
const vm = getCurrentInstance();
|
|
if (vm.type.name === 'QForm')
|
|
if (!['searchbarForm','filterPanelForm'].includes(this.$el?.id)) {
|
|
// AUTOFOCUS
|
|
const elementsArray = Array.from(this.$el.elements);
|
|
const firstInputElement = elementsArray.find(element => element.classList.contains('q-field__native'));
|
|
|
|
if (firstInputElement) {
|
|
firstInputElement.focus();
|
|
}
|
|
}
|
|
},
|
|
};
|