Skip to content

createWebHistory with relative path #1245

@Hellmy

Description

@Hellmy

What problem does this feature solve?

I have a tricky question and a working example is difficult as you also need a reverse proxy… but I hope you get my point when you try understanding following setup (vue3 with vue-router4)
Configure vue app with in index.html
The router is configured with createWebHistory()
The App is served from a subpath like example.com/my-app/
I want to have relative base url as I only want to build one image and use it on different paths.

What is expected:
The base routing path is appended to the current path, so a about page on /about looks like example.com/my-app/about

What is happening:
The route prefix “my-app” is deleted and navigation is internally working but the urls is wrong as it is example.com/about

When i configure my base with createWebHistory('/my-app/) i loose the possiblity to deploy my container on different context-paths with only one container. I would always have to rebuild the container what I want to avoid.

What does the proposed API look like?

createWebHistory works with relative path
Alternative would be a inspection of the base-href

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions