Coder Social home page Coder Social logo

Comments (10)

bailicangdu avatar bailicangdu commented on July 26, 2024 1

还是很关心这个切换缓存出来的大致时间。3Q

目前还没进入排期,keep-alive 微应用有一个很致命的问题,微应用再次显示和在离开时url地址可能会不一致,导致url和页面展示不统一。在这个问题没有很好的解决方案出来之前,单纯的实现keep-alive功能是没有意义的。

from micro-app.

bailicangdu avatar bailicangdu commented on July 26, 2024

默认不会保留状态,因为已经卸载了,只会保留静态资源,你可以通过display: none的形式隐藏,这样就不会触发卸载。不过卸载后保存状态理论上可以做的到,以后会加上这个功能。

from micro-app.

GOGOGOSIR avatar GOGOGOSIR commented on July 26, 2024

,因为已经卸载了,只会保留静态资源,你可以通过display: none的形式隐藏,这样就不会触发卸载。不过卸载后保存状态理论上可以做的到

我有一个疑问,如果通过display:none的形式隐藏,去实现应用之间切换时的状态的保留。如果一个应用里渲染了3000个dom节点,此时我已经开启了6个应用,按照这个方案,只有一个应用是显示的,其他5个应用是隐藏的(display:none),那会不会使得body下的DOM节点过多导致页面卡顿呢

from micro-app.

bailicangdu avatar bailicangdu commented on July 26, 2024

这是必然的,display: none是最简单直接的解决方案,如果担心多应用共存导致页面卡顿,可以在子应用卸载时将需要的数据状态上传到基座应用,再次渲染时从基座获取缓存的数据进行渲染

from micro-app.

GOGOGOSIR avatar GOGOGOSIR commented on July 26, 2024

次渲染时从基座获取缓存的数据进行渲染

这个场景只限于某个应用最后离开的页面的数据缓存。如果场景如下:我先开启应用 A 的 home 和 about 页, 然后我此时从 about 页转至应用 B 的 home 页,那此时,我只缓存了应用A 的 about 页的数据,如果,我这时去切换 tab 跳转至应用 A 的 home 页,那它依然要重新获取数据,重新渲染,然而这个对于切换页面的tab来说,代价有点高

from micro-app.

github-actions avatar github-actions commented on July 26, 2024

Since the issue was labeled with inactive, but no response in 7 days. This issue will be close. If you have any questions, you can comment and reply.
由于该 issue 被标记为不活跃,且 7 天未收到回应。现关闭 issue,若有任何问题,可评论回复。

from micro-app.

WWQ-CODE avatar WWQ-CODE commented on July 26, 2024

后面有规划处理子应用切换缓存问题吗?

from micro-app.

bailicangdu avatar bailicangdu commented on July 26, 2024

以后会增加这个功能,现在的重心在处理问题

from micro-app.

a124779683 avatar a124779683 commented on July 26, 2024

还是很关心这个切换缓存出来的大致时间。3Q

from micro-app.

bailicangdu avatar bailicangdu commented on July 26, 2024

已在0.6.0版本中支持,详情请查看:https://micro-zoe.github.io/micro-app/docs.html#/zh-cn/keep-alive

from micro-app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.