vue component sets v-model on focus off code example
Example: vue js focus ref
<input type="text" ref="searchbar">
<script>
export default {
mounted() {
this.$refs.searchbar.$el.focus();
}
};
</script>
<input type="text" ref="searchbar">
<script>
export default {
mounted() {
this.$refs.searchbar.$el.focus();
}
};
</script>