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'});//配置了路由
@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'});//配置了路由