import Vue from 'vue'
import Router from 'vue-router'
import Hello from '@/components/Hello'
import login from '@/components/login'
import reg from '@/components/reg'
import chen from '@/components/comy'

Vue.use(Router);//表示使用的是路由模块

export default new Router({
  routes: [
 
	//路由重定向 redirect 重新指定位置

    {
      path:'/',
      redirect:'/Hello'
    },
 
    {
      path: '/Hello',
      name: 'Hello',
      component: Hello
    },
    {
      path: '/reg/:user',
      name: 'reg',
      component: reg,
      children:[
        {
          path : '/chen',
          name :'chen',
          component:chen
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: login
    }

  ]
})
Logo

前往低代码交流专区

更多推荐