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

Hash router remove initial slash not working #2651

Closed
kingofdelphi opened this Issue Mar 15, 2019 · 4 comments

Comments

Projects
None yet
2 participants
@kingofdelphi
Copy link

kingofdelphi commented Mar 15, 2019

Version

3.0.1

Reproduction link

https://github.com/kingofdelphi/vue-realworld-example-app/blob/master/src/router/index.js

Steps to reproduce

  1. yarn install
  2. yarn serve

What is expected?

Clicking on links should change the address bar properly.
Typing the address on address bar should route to the proper page.
Browser refresh should not change url i.e. url must stay same on browser refresh / reload.

What is actually happening?

Clicking on links is changing the address bar properly with proper route(this is expected behavior)
Typing the address on address bar doesn't route to the proper page.
Browser refresh should not convert /#url to /#/url ie do not add slash automatically.


I had successfully used react-router to solve the problems listed above, but I can't seem to get it to work with vue-router.

@posva

This comment has been minimized.

Copy link
Member

posva commented Mar 15, 2019

You need to put an initial path in your routes path: '/'

@posva posva closed this Mar 15, 2019

@kingofdelphi

This comment has been minimized.

Copy link
Author

kingofdelphi commented Mar 15, 2019

You need to put an initial path in your routes path: '/'

Hi, actually, I want to remove the / after /#. For example /#/user should be /#user

@posva

This comment has been minimized.

Copy link
Member

posva commented Mar 15, 2019

that's not possible, that would be the actual hash of the route, we need that slash to make the difference

@kingofdelphi

This comment has been minimized.

Copy link
Author

kingofdelphi commented Mar 15, 2019

that's not possible, that would be the actual hash of the route, we need that slash to make the difference

I've actually done this with react router. So, I know its possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.