@yizhou-library/route-cache
v0.0.4
Published
路由缓存组件
Downloads
2
Readme
组件测试用例
@ewell/RouteCache
RouteCache 使用场景
- 微服务划分,spa应用节点进行路由缓存;
dependencies 为发布依赖包集合
:::dependencies { "dependencies": { "prop-types": "^15.7.2" }, "devDependencies": { "@types/react": "^16.9.2", "@types/react-dom": "^16.9.0", "react": "^16.9.0", "react-dom": "^16.9.0" } } :::dependencies
代码演示
:::demo RouteCache引用
// src/core/_utils/renderRoutes.js
//
import RouteCache from '@ewell/RouteCache';
const switchProps = { include: true, basename: "/frontend-ts-projects" };
return (
<RouteCache {...switchProps}>
{/* //route */}
<Route
key={route.key || i}
path={route.path}
exact={route.exact}
strict={route.strict}
render={props => {
return <route.component {...props} route={route} />;
}}
/>
</RouteCache>
)
:::
API
| 参数 | 说明 | 类型 | 可选值 | 默认值 | |---------- |-------- |---------- |------------- |-------- | | demo | 内容 | moment.Moment,Date,Function | large,small,mini | — |