S
S
Syndr0me2019-01-15 19:32:32
JavaScript
Syndr0me, 2019-01-15 19:32:32

How to make a static url in vue router?

import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import Profile from './views/profile.vue'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home
    },
    {
      path: '/myprofile',
      name: 'profile',
      component: Profile
    }
  ]
})

There is such a code, the transition is carried out from the home page after a certain action to the myprofile page. So it doesn’t work if you let it register manually, it says page not found, how to fix it?
Here is the working host ejja.ru
ejja.ru/myprofile

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikita Egorov, 2019-01-15
@svupol

https://router.vuejs.org/ru/guide/essentials/histo...

W
WebDev, 2019-01-15
@kirill-93

It's your web server settings that are wrong. It is necessary that everything after the slash leads to the index file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question