title: Can a component know its child-routes in vue-router
body: <pre class="lang-xml prettyprint-override"><code>&lt;Main&gt;
    &lt;router-view&gt;&lt;/router-view&gt;
  &lt;/Main&gt;
  </code></pre>
  
  <pre class="lang-json prettyprint-override"><code>[
    {
      path: '/',
      component: Intro,
    },
    {
      path: '/path1',
      component: Main,
      children: [{},{},{}]
    },
    {
      path: '/path2',
      component: Main,
      children: [{},{},{},{},{}]
    }
  ]
  </code></pre>
  
  <p>I want <code>Main</code> to know what child routes are defined for it.</p>
  
  <p>I created a function to crawl around the overall routes object and figure it out,  but its evaluated differently depending on <code>this.$router.currentRoute</code> which makes it verbose and terrifying and more complicated the more path options there are in the children. Is there a straightforward way for the parent component to know where it is within the routes and have a list of its children?</p>
  
  <p>IE in the main component how to I tell how many children I have and which of them is currently active? </p>