@@ -64,6 +68,7 @@ const onDataSaved = (formData, requestResponse) => {
-import { computed } from 'vue';
+import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
const emit = defineEmits(['update:modelValue', 'update:options', 'keyup.enter']);
@@ -17,7 +17,7 @@ const $props = defineProps({
const { t } = useI18n();
const requiredFieldRule = (val) => !!val || t('globals.fieldRequired');
-
+const vnInputRef = ref(null);
const value = computed({
get() {
return $props.modelValue;
@@ -40,6 +40,14 @@ const styleAttrs = computed(() => {
const onEnterPress = () => {
emit('keyup.enter');
};
+
+const focus = () => {
+ vnInputRef.value.focus();
+};
+
+defineExpose({
+ focus,
+});