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.

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b35830-2bfa8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b35830-2bfa8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?