Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Nested vue-router routes #65

Open
BinarySpike opened this issue Mar 18, 2019 · 1 comment
Open

Nested vue-router routes #65

BinarySpike opened this issue Mar 18, 2019 · 1 comment

Comments

@BinarySpike
Copy link

Based on this example:
vuejs/vue-router#298 (comment)

// router.js
import Vue from "vue";
import Router from "vue-router";
import Component from "components/component.vue";

Vue.use(Router);

export default new Router({
  mode: "history",
  routes: [
    {
      path: "somepath",
      component: Component,
      children: Component.routes
    }
  ]
});
// components/component.vue
import SomeChildComponent from './';

export default {
  routes: [
    { path: "/somechildpath", component: SomeChildComponent },
  ]
};

Is there a way to do this with httpVueLoader? The magic is on children: Component.routes. When I define routes on the module.exports = I can't find it on the resolved promise:

<template>
  <h1>Test</h1>
  <router-view></router-view>
</template>
<script>
  module.exports = {
    routes = { '/test', component: httpVueLoader('test.vue') }
  }
</script>
<style scoped>
</style>
@BinarySpike
Copy link
Author

Here's a vue issue that might shed some light on what I'm trying to accomplish with httpVueLoader:
vuejs/vue-router#715

Thanks!

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

No branches or pull requests

1 participant