Closed hannah-lin-sama closed 4 months ago
import { KeepAlive } from '@umijs/max'; import { Image, Select } from 'antd'; import { useState } from 'react'; const PageTest = () => { const [count, setCount] = useState(); return ( <div style={{ margin: 40 }}> <Select value={count} options={[ { value: '1', label: '选中1' }, { value: '2', label: '选中2' }, { value: '3', label: '选中3' }, { value: '4', label: '选中4' } ]} onChange={(value) => { console.log('onChange', value); setCount(value); }} /> <p> {count} </p> <Image height={300} width={500} src={'https://copyright.bdstatic.com/vcg/creative/cc9c744cf9f7c864889c563cbdeddce6.jpg@h_1280'} /> </div> ); }; export default () => <KeepAlive name="test-keepalive"><PageTest /></KeepAlive>;
添加autoFreeze={false}解决了 参考#225