title: Vue.js router - conditional component rendering
body: <pre><code> routes: [
  {
    path: '/',
    name: 'home',
    get component(){
      if(Vue.loggedIn){
        return Home
      }else{
        return Login
      }
    }  
  }
  </code></pre>
  
  <p>I've added a getter and seems to work fine but any variable or function i use in the if statement is undefined. even i've tried using global prototype.$var and mixin functions still with no success.</p>
  
  <p>All i need is if a user is logged in the path '/' renders Dashboard view and if not then Login is rendered to '/'.</p>
  
  <p>Note: I've used beforeEnter: and it works fine. but i don't want redirection.</p>