你瞅啥呢
摘要: 2023-11-30 记录实用小案例 —— react监听页面返回时执行事件 useEffect(() => { const handlePageBack = () => { // 此处写你想要触发的事件 }; // 监听浏览器的 popstate 事件,即页面返回事件 window.addEventListener('popstate', handlePageBack); 阅读全文
posted @ 2023-11-30 09:28 叶乘风 阅读(481) 评论(0) 推荐(0)