@jackgreen/react-router-view
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "@jackgreen/react-router-view", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "main": "dist/index.min.js", |
@@ -16,2 +16,8 @@ # react-router-view | ||
{ | ||
path: '/', | ||
component: Home, | ||
// 精确匹配 | ||
exact: true | ||
}, | ||
{ | ||
path: '/single', | ||
@@ -33,2 +39,14 @@ component: Single | ||
] | ||
}, | ||
// 配置 404 | ||
{ | ||
path: '/404', | ||
component: NotFound | ||
}, | ||
// 其他没有匹配到的路由,都会重定向到 404 | ||
// 必须放在最后,原理是渲染 Redirect 组件 | ||
{ | ||
path: '*', | ||
// 重定向到 404 | ||
redirect: '/404' | ||
} | ||
@@ -35,0 +53,0 @@ ] |
10221
98