How do I reload page on click of Vuetify Button?

Multi tool use
Multi tool use


How do I reload page on click of Vuetify Button?



I need to refresh the current page when a user clicks the refresh button. I'm using Vuetify to generate the button.


<v-btn fab dark>
<v-icon dark>refresh</v-icon>
</v-btn>



I know in place of the router I can specify <v-btn fab dark to="myDesiredPath" but I need to refresh whatever route the user is currently on.


<v-btn fab dark to="myDesiredPath"



I know in vanilla js I can use location.reload(), but I don't know how to feed that to the button on the user's click.





Update: I used <v-button fab dark onclick="location.reload(true)> which works but it causes a problem with some routes not rendering with their props
– Jeff
1 min ago


<v-button fab dark onclick="location.reload(true)>




1 Answer
1



you can just create a method in Vue that runs the vanilla JS and then run that method @click of the v-btn.


@click


methods: {
reloadPage(){
window.location.reload()
}
}






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

kd8c1F,PpN0beUqpRzTOZyKO Oz5,mD
2ryuTmoHUvFYNikXn T0D3,DKtCE2 aVuR,LX9kfXN,vw,QqFP

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications