Vite使用react-router-config
####Vite使用react-router-config
React属于目前主流前端框架,但有一个缺点,创建项目很慢
npx create-react-app xxx
所以我一般使用Vite创建React项目
但最近发现一个问题:vite使用react-router-config,是不能在routes路由规则中进行重定向的。
最后解决方案是 不用react-router-config,自己封装了一个方法。(仅供参考)
class App extends React.Component {
// 自己
原创
2021-07-06 08:23:19 ·
1185 阅读 ·
0 评论