【发布时间】:2021-04-12 20:28:27
【问题描述】:
我想在 VUEJS 方面得到一点帮助。 我有一个表格,我有一个文本框。单击输入按钮时,它会给我一些结果并清除文本框,但闪烁的光标不会回到文本框。 关于如何实现它的任何想法 ->
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
这是我的代码:
<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>
我收到此错误:
this.$refs.track.focus is not a function
【问题讨论】:
标签: javascript vue.js vue-component bootstrap-vue vuejs3