vue ts 监听路由改变

@Watch('$route')
routechange(to: any, from: any) {
let routelink: string = to.path;
if (routelink === '/explorer') {



this['$router'].replace({path: '/electromagnetic'})//直接修改地址
this['$router'].replace({name: 'explorer'});//配置了路由
posted on 2019-05-29 10:45  忆小样  阅读(3806)  评论(0编辑  收藏  举报