Closed hongquan closed 1 month ago
@hongquan, I think this is a good suggestion since the pattern is commonly used.
However, I also think we can solve for your use case rather simply unless I'm missing something that base
option does in vue-router.
If you simply create a base route that acts as the parent to whatever base routes you currently have, this should achieve the same end goal.
// this route won't be navigable, will use `<RouterView />` as component by deafult
const baseRoute = createRoute({
path: "/p/"
})
// routes supplied to router does not need to include `baseRoute` for this to work
const routes = [
createRoute({
parent: baseRoute,
name: "foo",
// actual path will be "/p/foo"
path: "foo",
...
})
] as const
@stackoverfloweth Thanks.
For example, we want our Vue app to run at
/p/
URL. Invue-router
, we achieve that bycreateWebHistory
, but in@kitbag/router
, I haven't found an equivalent.