给入口加一个key,key是该组件的唯一标识
<router-view :key="key"></router-view>
// 给key值加时间戳,保持唯一性
computed: {
key() {
return this.$route.name !== undefined? this.$route.name +new Date(): this.$route +new Date()
}
}
给入口加一个key,key是该组件的唯一标识
<router-view :key="key"></router-view>
// 给key值加时间戳,保持唯一性
computed: {
key() {
return this.$route.name !== undefined? this.$route.name +new Date(): this.$route +new Date()
}
}