Problem Statement
What does <keep-alive> do and when should you use it?
Explanation
<keep-alive> caches inactive component instances instead of destroying them. It’s ideal for expensive views like tab content or route views where state and scroll position should be preserved. Avoid caching memory-heavy components indiscriminately.
Code Solution
SolutionRead Only
<keep-alive include="UserList,UserDetail"> <router-view /> </keep-alive>