Coder Social home page Coder Social logo

Comments (3)

MAXLZ1 avatar MAXLZ1 commented on June 20, 2024

利用vue的keep-alive进行缓存,实现思路就是在主应用中新建一个页面用来展示子应用的某个页面,然后将这个页面添加到keep-alive的include中。这样做的缺点就是,对于每个子应用需要缓存的页面都需要在主应用新建一个页面。

from micro-app-demos.

NINGyv179 avatar NINGyv179 commented on June 20, 2024

利用vue的keep-alive进行缓存,实现思路就是在主应用中新建一个页面用来展示子应用的某个页面,然后将这个页面添加到keep-alive的include中。这样做的缺点就是,对于每个子应用需要缓存的页面都需要在主应用新建一个页面。

我试了一下,但是每次都是会重新请求,难道是因为我没用loadMicroApp,而是用registerMicroApps的原因

from micro-app-demos.

MAXLZ1 avatar MAXLZ1 commented on June 20, 2024

用loadMicroApp加载可以,registerMicroApps会根据url的变化进行加载。

onMounted(() => {
app = loadMicroApp({
name: 'reactAppKeepAlive',
entry: reactAppEntry,
container: container.value!,
props: {
path: '/reactApp/tab-view'
}
})
})

from micro-app-demos.

Related Issues (4)

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.