How to reload/refresh a webpage in Vue.js after a certain event or a button is clicked?

13,920

Just use window.location.reload().

<template>
  <button @click="reloadPage">Reload</button>
</template>


<script>
export default {
  ...
  methods: {
    reloadPage() {
      window.location.reload();
    }
  }
}
</script>
Share:
13,920

Related videos on Youtube

skate_23
Author by

skate_23

Working as a Software Engineer @Augmio Inc. Former Software Engineering Intern at BGC Partners and Tesla. Masters in Computer Science student from Rochester Institute of Technology specializing in Artificial Intelligence.

Updated on June 04, 2022

Comments

  • skate_23
    skate_23 almost 2 years

    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.