第一: vue-navigation 有个重要的功能就是保存页面的状态,和keep-alive相似 第二: 页面自动生成的刷新标识 这里可以改名字 在main.js中改 Vue.use(Navigation, {router,keyName: 'VNKS'}) 第三: 实现前进刷新,后退不刷新 前进、后退分别使用不同的过场动画。 第四: vue-navigation 支持如下 5 种事件类型的监听: forward:前进 back:后退 replace:替换 refresh:刷新 reset:重置 对应的监听方法: this.$navigation.on('forward', (to, from) => { console.log('forward to', to, 'from ', from) }) this.$navigation.on('back', (to, from) => { console.log('back to', to, 'from ', from) }) this.$navigation.on('replace', (to, from) => { console.log('replace to', to, 'from ', from) }) this.$navigation.on('refresh', (to, from) => { console.log('refresh to', to, 'from ', from) }) this.$navigation.on('reset', () => { console.log('reset') } 监听方法有 on()、once()、off() 这 3 种 this.$navigation.once('forward', () => { console.log('appear once') }) const off = () => { console.log('will not appear') } this.$navigation.on('forward', off) this.$navigation.off('forward', off) https://blog.csdn.net/weixin_45048913/article/details/114631645