当vue 3 中A页面刷新本身, 使用间接跳转实现:
    A -> B, 再由B->A

    warn 代码:

    1. <script>
    2. import { h } from 'vue'
    3. export default {
    4. created() {
    5. const { params, query } = this.$route
    6. const { path } = params
    7. this.$router.replace({ path: '/' + path, query })
    8. },
    9. render() {
    10. return h() // avoid warning message
    11. }
    12. }
    13. </script>

    image.png

    解决方案: 不用render方法, 直接用静态template:

    1. <template>
    2. <div></div>
    3. </template>
    4. <script>
    5. export default {
    6. created() {
    7. const { params, query } = this.$route
    8. const { path } = params
    9. this.$router.replace({ path: '/' + path, query })
    10. }
    11. }
    12. </script>

    解决warn