Vue3 jumps to the same page, the path is the same, and the page does not refresh when the passed parameters are different

In vue3, when the route is the same, but the parameter quary is different, the jump will not be refreshed

When the path of the route is the same, but the quary is different, methods such as onMounted will not be executed during the jump, and the page will not be refreshed.

method:

Modify the router-view and add a key to the label on the app.vue page. When the key is different, it will be refreshed.
The complete code snippet is as follows

<template>
  <router-view :key="route.fullPath"></router-view>
</template>
<script  setup>
import { useRoute } from 'vue-router'
    const route = useRoute()
</script>

Guess you like

Origin blog.csdn.net/m0_70547044/article/details/132446669