Vue 2 not working with and key

前端 未结 4 1827
旧巷少年郎
旧巷少年郎 2020-12-19 16:55

I\'m using vue-router with a series of components like tabs. Each is a tab and the space below is the . Two

4条回答
  •  清酒与你
    2020-12-19 17:35

    Just because your component is re-mounted and therefore fires your function on the mounted hook doesn't mean it was ever destroyed. To test if it was kept alive, console log something on the destroyed hook, and if it doesn't fire the console log, the keep-alive is working. I've run your same code, and it seems to work in Vue 2 at least.

提交回复
热议问题