Skip to content
字数
51 字
阅读时间
1 分钟

类似 Vue 中的路由守卫 (路由的生命周期)

js

const location = useLocation();

useEffect( ()=> {
   console.log(location.pathname,"进入了路由");
   return ()=> {
	   console.log(location.pathname,"离开了路由")
   }
}. [location.pathname])

贡献者

The avatar of contributor named as rover rover

页面历史

Power by nolebase