When in hash mode, initial components are not reused
[issue link]In hash router mode, route component instances that participate in initial load are not reused, and are getting destroyed and recreated when going from e.g. /items/1 to /items/2.
Nuxt version: 1.0.0-rc.3, but happens in 0.10.7 too.
E.g. the following route structure:
{
path: '/items',
component: Items, // `Items` has mounted and beforeDestroy hook
children: [
{ path: ':id', component: Item }, // `Item` has mounted and beforeDestroy hook
],
}
Expected:
- Go to
/items/1. - Refresh the page, see
mountedcalled for both components. - Go to
/items/2, see no hooks called (instances are reused).
Actually happens:
- Go to
/items/1. - Refresh the page, see
mountedcalled for both components. - Go to
/items/2, seebeforeDestroyand thenmountedcalled for both components. - Go to
/items/3, see no hooks called (instances are reused).
Repro: https://github.com/simplesmiler/nuxt-issue
Likely the issue is either with normalizeComponents or when it happens (or does not happen).