Vue routing problem

I don"t know what went wrong. The route will not jump after clicking

but the path jumps from http://localhost:8080/-sharp/ to http://localhost:8080/-sharp/userinfo

the content of the display is blank, and there is something

written in it.

router / index.js

import Vue from "vue"
import Router from "vue-router"
import index from "@/components/index"
import userinfo from "@/components/home/userinfo"

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: "/",
      name: "index",
      component: index,
      children: [
        {
          path: "/userinfo",
          name: "userinfo",
          component: userinfo
        }
      ]      
    }
  ]
})



the userInfo, in your link, the path in your route is userinfo


this is just a life route. You need to create a vue instance


path:'/ userinfo' and change it to path: 'userinfo'


.

I guess < router-view > < / router-view >

is not written in your index component. < hr >

try adjusting the routing structure like this:

import Vue from 'vue'
import Router from 'vue-router'
import index from '@/components/index'
import userinfo from '@/components/home/userinfo'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      component: index   
    }
    {
      path: '/userinfo',
      name: 'userinfo',
      component: userinfo  
    }
  ]
})

take a look at this document. There is a problem with the word routing configuration. You cannot add / https://router.vuejs.org/zh-c.

.
Menu