How to refresh vue-router manually when entering the page

I used this.$router.push () to jump to a page, but I didn"t get my data. I got it by refreshing it manually. I think it was refreshed manually when I first entered the page. How can I do that?

Apr.26,2022

this.$router.replace({
    path: '/refresh',
    query: {
      t: Date.now()
    }
  })

is not the right way to solve the problem. I suggest you break the debugging point.
1. Obtaining data certainly does not need an extra refresh.
2. See if the method to get the data has been called during the life cycle of the vue.


the idea of solving the problem is not correct. You can obtain data in the execution of created . If you enter route.push, you can route it under watch if you don't execute it, and then get the method that executes the data acquisition.

created(){
    //created
    this.getData()
},
methods: {
    getData(){
        //ajax
    }
},
watch: {
    //route.pushwatch
    $route(){
        this.getData()
    }
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be5792-31775.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be5792-31775.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?