JavaScript/react/路由

来自康健生活

标题文字

import { useLocation } from 'react-router-dom'; //引入useLocation
const { pathname } = useLocation(); // 存储当前路由地址