<input type="text" ref="comment" maxlength="100" v-model="message" placeholder="发表你的评论" @search.stop="onSearch" @blur="inputBlur">
this.$nextTick(() => {
this.$refs.comment.focus();
})
inputBlur() {
window.scroll(0, 0);
}
<input type="text" ref="comment" maxlength="100" v-model="message" placeholder="发表你的评论" @search.stop="onSearch" @blur="inputBlur">
this.$nextTick(() => {
this.$refs.comment.focus();
})
inputBlur() {
window.scroll(0, 0);
}