修改地址栏参数,刷新页面

40 阅读1分钟

给出口设置key

<template>
  <div id="app">
    <router-view :key="key" />
  </div>
</template>

<script>
export default {
  name: "App",
  computed: {
    key() {
      return this.$route.name ? this.$route.name + +new Date() : this.$route + +new Date();
    },
  },
};
</script>