umi中如何实现路由缓存

使用umi-plugin-keep-alive实现KeepAlive状态存储

二者选一

$ npm install umi-plugin-keep-alive --save
$ yarn add umi-plugin-keep-alive

使用

import { KeepAlive, history } from 'umi';
   <KeepAlive>
     <Page />
   </KeepAlive>
};

使用介绍:https://www.npmjs.com/package/umi-plugin-keep-alive


版权声明:本文为weixin_45389051原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。