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

It should be supported in routing for uncertain running path after packaging #261

Closed
wyx11223344 opened this issue May 20, 2020 · 4 comments

Comments

@wyx11223344
Copy link

What problem does this feature solve?

If I am a developer and don't know which secondary or even tertiary directory the O & M personnel will deploy to, then I will not be able to set the base path in the createwebhashhistory() method, so I need to communicate the location of the project package with the O & M personnel when I pack, and when I deploy to different environments and paths, the modification of the base path will It will make me confused.

What does the proposed API look like?

I hope vue-router can help me get the base path automatically

@pikax
Copy link
Member

pikax commented May 20, 2020

If you use hashHistory the base location should be:

const {origin, pathname}= new URL('https://test.ex/my/sub/directory#myrouter'); // location object

const basePath = origin + pathname; // https://test.ex/my/sub/directory

@wyx11223344
Copy link
Author

Thank you for your reply. I just hope vue-router can handle this situation. I have already set this in my project

@posva posva closed this as completed in 0078147 May 20, 2020
@posva
Copy link
Member

posva commented May 20, 2020

@wyx11223344 next time provide a repro using the starter at https://new-issue.vuejs.org/?repo=vuejs/vue-router-next. I had a very hard time understanding the bug you were reporting

@wyx11223344
Copy link
Author

Thank you very much.I'll describe it more clearly next time

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

No branches or pull requests

3 participants