react-activation icon indicating copy to clipboard operation
react-activation copied to clipboard

组件数据量大,导致缓存失效。

Open Huhui-coder opened this issue 2 years ago • 1 comments

使用 react-activation 来对 antd 中的 tabs 组件进行缓存,当 TabPane 中组件内容过多时,缓存会失效。当 TabPane 中组件内容不多时,缓存是正常的,并且滚动条位置也能保存下来。

    <AliveScope>

<Tabs
                  hideAdd
                  onChange={onChange}
                  activeKey={activeKey}
                  type="editable-card"
                  onEdit={handEdit}
                >
                  {panes.length > 0 && panes.map((pane: any) => (
                    <TabPane tab={pane.title} key={pane.key}>
                      <KeepAlive>
                        {pane.content}
                      </KeepAlive>
                    </TabPane>
                  ))}
                </Tabs>
                ...

     </AliveScope>

Huhui-coder avatar Oct 23 '23 03:10 Huhui-coder

如果可以的话,希望提供一个在线示例,最近比较忙

CJY0208 avatar Oct 24 '23 01:10 CJY0208