vue-cli 路由重定向
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/co
·
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 } ] })
更多推荐
已为社区贡献14条内容
所有评论(0)