Using UMI plugin keep alive to store the keep alive state
1
$ npm install umi-plugin-keep-alive --save
//or
$ yarn add umi-plugin-keep-alive
2. Use
import { KeepAlive } from 'umi'
const contentList = () => {
return (
<>
<KeepAlive
name="/About" //Can unload the <KeepAlive> node in the cached state by name
saveScrollPosition="screen" //automatically saves the scroll position of the shared screen container
when={true} > //true unloads when cached, false unloads when not cached
<About/> //Component to save state for
</KeepAlive>
</>
)
}
This function is based on react activation. For more details, please refer to react activation
Read More:
- Keep alive in Vue
- Error report of windows system running UMI project
- Solution to page scroll bar failure caused by opening secondary spring frame in Ant Design modal form
- Deploy mongodb fragment combined with replica set to realize distributed storage of MySQL database files (step 10)
- Solve the problem of showing unregistered (unknown custom element) when importing components into Ant Design Pro
- Ant Design upload listtype = “picture card” realizes multi image upload and click preview image encapsulation
- Ant Design proformdigit fieldprops limits the number of decimal places entered
- Failed to load plugin react: cannot find module ‘eslint plugin react’ appears when running Vue project‘
- Error in DESeqDataSet(se, design = design, ignoreRank) : some values in assay are negative
- Ant Design ‘cross env’ is not an internal or external command, nor is it an error reporting problem for a runnable program
- Plugin Error: Plugin “Android Code Generator“ is incompatible (supported only in IntelliJ IDEA)
- Failed to load plugin jsdoc: Cannot find module ‘eslint-plugin-jsdoc‘
- How to realize automatic assembly in springboot
- extract-text-webpack-plugin" loader is used without the corresponding plugin Error (Fixed)
- QT encountered in CentOS installation( qt.qpa.plugin : Could not load the Qt platform plugin “xcb” )
- Error resolving version for plugin ‘org.apache.maven.plugins:maven-compiler-plugin’ from the repo…
- Learn English together | three ways to realize digital factorial with JavaScript
- Insufficient space in the root directory causes the state of the managed server to become FAILED_NOT_RESTARTABLE
- Solution to 1030 got error 28 from storage engine in MySQL
- Failed to read auto-increment value from the storage engine in MySQL