摘要: 全局的:进入任何一个路由都会执行 beforeEach(to, from, next):进入路由前执行 // 在渲染该组件的对应路由被 confirm 前调用 // 不!能!获取组件实例 `this` // 因为当守卫执行前,组件实例还没被创建 beforeResolve(to, from, nex 阅读全文
posted @ 2021-02-23 10:54 张尊娟 阅读(124) 评论(0) 推荐(0) 编辑
摘要: const originalPush = Router.prototype.push // 获取原型对象上的push函数 Router.prototype.push = function push (location) { // 修改原型对象中的push方法 return originalPush. 阅读全文
posted @ 2021-02-23 10:44 张尊娟 阅读(103) 评论(0) 推荐(0) 编辑