路由信息按钮监听事件

1.路由是通过url地址改变的监听来实现路由组件动态切换

来实现的url地址和页面组件的更新

//监听window对象事件能拿到地址的信息,可以拿到登录页面的token信息
window.addEventListener('hashchange',function(){
            console.log('-----------',location.hash)
});

 

posted @ 2022-02-16 16:42  cc-front  阅读(50)  评论(0)    收藏  举报