#2478·vue-router

component seems to be destroyed incorrectly

Author: ksora94Created Nov 15, 2018Updated Jul 15, 2025
Labelskeep-alivefixed on 4.x

Version

3.0.1

Reproduction link

https://codesandbox.io/s/zx88kqjzj4

Steps to reproduce

  • Enter pageA.
  • Click "pageB" to enter pageB .
  • Click "pageC" to enter pageC from pageB.
  • Click "pageA and pageB", then back to pageB.
  • It's back to pageA, but the URL bar show it's in pageB.

What is expected?

back to pageA correctly

What is actually happening?

I can not back to pageB, and the pageA component seems to be destroyed.


...I'm not sure that the problem is caused by vue-router. Maybe it's caused by keep-alive component.