0👍
Add a ref to the input :
<b-form-input
placeholder="Name *"
name="name"
autofocus
ref="nameRef"
></b-form-input>
then in mounted hook :
mounted(){
this.$refs.nameRef.focus()
}
- [Vuejs]-How to handle firebase authentication on vue
- [Vuejs]-How to display a PDF generated with express/pdfkit in browser from api-endpoint
0👍
When I inserted your code into an HTML file, it just did nothing, nothing showed up. By just removing the b-form-
it worked and it also focused when I loaded the page without me doing that. So I guess that works, sorta. But I don’t quite know vue so I hope that this isn’t terribly wrong and the b-form is totally fine, I apologize in that case.
Source:stackexchange.com