router-view定义ref
<router-view class="child-view" ref="pageContainer"></router-view>
清除缓存
const {cache, keys} = this.$refs.pageContainer.$options.parent;
// 遍历删除,或指定删除路由缓存
keys.forEach(key => {
delete cache[key];// 删除指定路由缓存
})
// 将值清空
keys.splice(0, keys.length - 1);