0

I am using Vue("vue": "^2.5.2") to make a SPA,this is my route("vue-router": "^3.0.1"):

routes: [
    {
      path: '/',
      name: 'Home',
      component: Home
    }]

when I request : http://localhost:8080.It could open the page.But when I tweak the route like this:

routes: [
        {
          path: '/home',
          name: 'Home',
          component: Home
        }]

And I request : http://localhost:8080/home .It could not open the page.Why would this happen ,how to fix it?

1 Answer 1

3

As stated in the vue router docs:

The default mode for vue-router is hash mode - it uses the URL hash to simulate a full URL so that the page won't be reloaded when the URL changes.

You should find your page at http://localhost:8080/#/home

You can read more about this here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.