Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

router-view not updating after v-if resolves to true #109

Closed
rpkilby opened this issue Aug 31, 2015 · 1 comment
Closed

router-view not updating after v-if resolves to true #109

rpkilby opened this issue Aug 31, 2015 · 1 comment

Comments

@rpkilby
Copy link

rpkilby commented Aug 31, 2015

If a router-view is wrapped inside of a v-if directive, it won't update once the v-if directive resolves to true. A couple of thoughts - It might make sense to warn the user when no router-view is present. Alternatively, the router-view could wait to transition until it detects a router-view has been inserted inside the router's root selector.

Notes:

  • Neither calling router.go() nor clicking on v-links to the route will update the router-view.
  • The router is not failing, as changing routes does update the router-view/component.
  • Only the component's canActivate hook was called.

Example fiddle: http://jsfiddle.net/xn7tmbdn/4/

@t2t2
Copy link

t2t2 commented Aug 31, 2015

A way to bypass this is to delay the transition with router.beforeEach until v-if inserts content: http://jsfiddle.net/xn7tmbdn/5/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants