After a page is cached, the page does not change. To cache page changes, use the routed hook function beforeRouteLeave.

<template>
  <div
  </div>
</template>
<script>
export default {
  methods: {},beforeRouteLeave(to, from, next) {
    // called when navigating away from the component's corresponding route
    // Access component instance 'this'
    console.log(to);
    if(to.name ! = ="myQuestionDetail") {
      this.getQuestionList();
    }
    next();
  },
  mounted() {
    this.getQuestionList(); }};</script>
Copy the code