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

如何使用keeplive #198

Open
szvone opened this issue Feb 10, 2019 · 1 comment
Open

如何使用keeplive #198

szvone opened this issue Feb 10, 2019 · 1 comment

Comments

@szvone
Copy link

szvone commented Feb 10, 2019

如何使用缓存机制

@longyufei109
Copy link

  • 修改了keep-alive的配置在src/components/app/index.vue
<div von-app>
    <navbar></navbar>
    <transition name="page" v-on:before-enter="beforePageEnter">
        <router-view></router-view>
    </transition>
</div>
改为了:
  <div von-app>
    <navbar></navbar>
    <transition name="page" v-on:before-enter="beforePageEnter">
      <keep-alive>
        <router-view v-if="$route.meta.keepAlive" :key="$route.fullPath"></router-view>
      </keep-alive>
    </transition>
    <transition name="page" v-on:before-enter="beforePageEnter">
        <router-view v-if="!$route.meta.keepAlive"></router-view>
    </transition>
  </div>

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