I'm trying to figure out how to have 2 different components on same route with Vue.
Main page or login page, depends if user is authenticated. Maybe im missing something in documentation, but i cant and cant figure it out. Is it even possible?
Thx
I'm trying to figure out how to have 2 different components on same route with Vue.
Main page or login page, depends if user is authenticated. Maybe im missing something in documentation, but i cant and cant figure it out. Is it even possible?
Thx
use auth param in router map:
and then check before each transition:
So you need dynamic components.
in whichever Vue is a parent to these components use a computed property that returns the name of component you want to use, based on the authenticated state:
http://vuejs.org/guide/components.html#Dynamic-Components