Vue solves the page refresh problem-the path changes the page does not change

Add: key="key" in <router-view>< /router-view> in main.js!

<template>
  <div>
    <router-view :key="key()"></router-view>
  </div>
</template>

<script>
	export default {
    
    
	  name: 'App',
	  methods:{
    
    
	    key(){
    
    
	      return Math.random();
	    }
	  }
	}
</script>

Guess you like

Origin blog.csdn.net/xiaozhezhe0470/article/details/108927469