Solution 1 :

Just use window.location.reload().

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


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

Problem :

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.

By

Leave a Reply

Your email address will not be published. Required fields are marked *