JavaScript/react/路由

来自康健生活
Kangkk​(留言 | 贡献)2021年4月11日 (日) 16:22的版本 (创建页面,内容为“== 标题文字 == <syntaxhighlight lang="javascript"> import { useLocation } from 'react-router-dom'; //引入useLocation const { pathname } = useLocation(); // 存…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

标题文字

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