Skip to content

Commit

Permalink
docs: 优化注释
Browse files Browse the repository at this point in the history
  • Loading branch information
huangmingfu committed Nov 5, 2024
1 parent ef4d16a commit b9d66f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"stylelint.vscode-stylelint"
"stylelint.vscode-stylelint",
"mikestead.dotenv"
]
}
5 changes: 4 additions & 1 deletion src/router/utils/route-guard.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
/**
* 第二种实现路由守卫的方式(参考):使用高级组件包裹,监听pathname,在useEffect中作路由守卫。
* 第二种实现路由守卫的方式(参考):使用高级组件方式,监听pathname,在useEffect中作路由守卫。
* 不确定的影响(来源网上评论):
* 在useEffect 里去做路由守卫的话是否会出现页面内容加载完后以及触发接口调用后才跳出页面的情况。
*
* React-Ts-Template 默认使用的是第一种实现方式,如果更喜欢下面这种,可以根据情况修改;
* 如果使用默认的实现,可以将此文件删除。
*
* 其他封装拦截组件方式参考:
* https://segmentfault.com/a/1190000044439881
*/
import { FC, ReactNode, useEffect } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
Expand Down

0 comments on commit b9d66f5

Please sign in to comment.