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

keepalive:true in definePageMeta doesn't work in right way #20378

Closed
gyhyfj opened this issue Apr 19, 2023 · 2 comments
Closed

keepalive:true in definePageMeta doesn't work in right way #20378

gyhyfj opened this issue Apr 19, 2023 · 2 comments

Comments

@gyhyfj
Copy link

gyhyfj commented Apr 19, 2023

Environment

  • Operating System: Windows_NT
  • Node Version: v18.16.0
  • Nuxt Version: 3.4.1
  • Nitro Version: 2.3.3
  • Package Manager: pnpm@8.2.0
  • Builder: vite
  • User Config: modules, vite, css, imports, pinia, app, ignore, telemetry, appConfig, devServer, nitro
  • Runtime Modules: @nuxtjs/tailwindcss@6.6.6, @pinia/nuxt@0.4.8, @pinia-plugin-persistedstate/nuxt@1.1.1, @element-plus/nuxt@1.0.4
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-ugcjd1?file=pages/index.vue

Describe the bug

keepalive:true in definePageMeta cannot keep values in page and can always trigger onMounted
but can trigger onDeactivated

Additional context

No response

Logs

No response

@DamianGlowala
Copy link
Member

See why this doesn't work for you #15214 (comment) and how you can make it work #15255 (comment).

@gyhyfj
Copy link
Author

gyhyfj commented Apr 19, 2023

Thank you, it's really confusing

@gyhyfj gyhyfj closed this as completed Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants