Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Huhui-coder opened this issue Oct 23, 2023 · 1 comment
Open

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

Huhui-coder opened this issue Oct 23, 2023 · 1 comment

Comments

@Huhui-coder
Copy link

Huhui-coder commented Oct 23, 2023

使用 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>
@CJY0208
Copy link
Owner

CJY0208 commented Oct 24, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants