Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

UsmanBasharmal's avatar

Vuejs and Page Refresh on <router-link> click

I want to make a page refresh after I click on the router-link. How can I do that with Vue JS in Laravel? but I don't want to use onclick="window.location.reload();"

My code is something like that-

Code in app.js

{
    path: '/publisher',
    component: require('./components/Publishers.vue').default,
  }

Code in Master.blade.php

<li> <router-link to="/publisher" class="nav-link"  >خنتشارات</router-link></li>

Code in publishers.vue

export default {
  components: {  
  },
  data() {
    return {
     
      Publishers: {},
     
    };
  },
  computed: {},
  methods: {    
    loadPublishers() {
      this.$Progress.start();
      axios.get("api/publisher").then(({ data }) => (this.Publishers = data));
    },
  },

  created() {
    this.loadPublishers();
    // load the page after 3 secound
    Fire.$on("refreshPage", () => {
      this.loadPublishers();
    });
  }
};
0 likes
5 replies
MaverickChan's avatar

what do you mean you wanna a page refresh AFTER you clicked a router-link? It is not possible to refresh the original page , because you have been sent to another place

tykus's avatar

You do not want a router-link if you want a full page refresh; just use a regular anchor tag.

tykus's avatar
tykus
Best Answer
Level 104

Using an <a> element

<li>
	<a href="/publisher" class="nav-link"  >خنتشارات</a>
</li>

Please or to participate in this conversation.