Using router-view inside template replace-part
valichek opened this issue · comments
I have code like:
<my-comp>
<template replace-part="middle">
<router-view containerless></router-view>
</template>
</my-comp>
I get Error: There was no router-view found in the view
when I navigate to that page from other page, but it renders ok when enter that page directly.
So question: Is this code good or tricky?
The router view needs to be inside the view to which the view model's router is associated.When you use a template part, you are specifying to take that router view out of the current view and render it inside the internal view of the my-comp. So, the router view is no longer present and thus no router view is found.