I want to reload a webpage just once everytime after pressing a button on the webpage. I have written my code in Vue.js. How do I achieve this?
Note: I do not want to auto-refresh after specific interval of time. Instead just once after everytime that button on the webpage is clicked.
I would appreciate any help given. Thank you.
Just use window.location.reload()
.
<template>
<button @click="reloadPage">Reload</button>
</template>
<script>
export default {
...
methods: {
reloadPage() {
window.location.reload();
}
}
}
</script>