I wanted a small help in VUEJS. I have a form and i have a text box. When clicking the enter button its gives me some result and clears the text box but the blinking cursor doesn't come back to the text box. Any idea on how to achieve it ->
1. I write some text in the text box
2. Presses Enter
3. Provides some info and clears the text box
4. Same text box starts to blink and i need to be able to write something back again
Here is my code:
<template>
<div class="app-container app-card">
<div class="app-content">
<b-form-input-with-validation
v-model="number"
:rules="{max: 255, required: true}"
label="number"
name="number"
type="text"
@keyup.enter="onSubmitClick"
ref="track"
/>
</div>
</div>
</template>
<script>
export default {
methods: {
reset() {
this.innerValue.tracking_number = null
},
async onSubmitClick() {
this.$refs.track.focus()
},
},
data() {
return {
track: null,
}
},
}
</script>
I am getting this error:
this.$refs.track.focus is not a function