mirror of
https://github.com/kou029w/_.git
synced 2025-02-07 09:38:46 +00:00
静的ページに対応
This commit is contained in:
parent
c8c3ec30dc
commit
2587ffba66
1 changed files with 5 additions and 1 deletions
|
@ -14,7 +14,11 @@ const TopAppBar: React.FC<{ router: any }> = ({ router }) => {
|
|||
routes.findIndex(({ pathname }) => pathname === router.pathname)
|
||||
);
|
||||
router.events.on("routeChangeStart", (url: string) => {
|
||||
setValue(routes.findIndex(({ pathname }) => pathname === url));
|
||||
setValue(
|
||||
routes.findIndex(
|
||||
({ pathname }) => pathname === url.replace(/(?<=.)\/$/, "")
|
||||
)
|
||||
);
|
||||
});
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
|
|
Loading…
Add table
Reference in a new issue