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

Allow to use without RouterLayout #25

Closed
IlyaSemenov opened this issue Jan 23, 2020 · 1 comment · Fixed by #26
Closed

Allow to use without RouterLayout #25

IlyaSemenov opened this issue Jan 23, 2020 · 1 comment · Fixed by #26

Comments

@IlyaSemenov
Copy link
Contributor

The following code:

import Vue from "vue"
import routes from "vue-auto-routing"
import VueRouter from "vue-router"

Vue.use(VueRouter)

const router = new VueRouter({
	mode: "history",
	base: process.env.BASE_URL,
	routes,
})

export default router

emits this warning:

[vue-router] Non-nested routes must include a leading slash character. Fix the following routes: 

Is there an elegant way to have vue-auto-routing emit non-nested routes, e.g. with a certain webpack loader option? Note that I'm deliberately avoiding the layouts plugin (which surfaced this unwanted coupling between the modules).

For now, I'm using this:

const router = new VueRouter({
	mode: "history",
	base: process.env.BASE_URL,
	routes: routes.map(route => ({ ...route, path: "/" + route.path })),
})
@IlyaSemenov
Copy link
Contributor Author

I see nested is hardcoded here:

Can't you simply merge all options from options.pluginOptions into defaults? I would also like to disable dynamic imports which isn't currently possible either.

IlyaSemenov added a commit to IlyaSemenov/vue-cli-plugin-auto-routing that referenced this issue Jan 23, 2020
@ktsn ktsn closed this as completed in #26 Feb 9, 2020
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

Successfully merging a pull request may close this issue.

1 participant