使用router-view

98 阅读1分钟

在创建项目时,有一个公共的头部标签,作为一个组件,使用<router_view>占位其他组件,开始一直没有成功,是因为在router/index.js中 没有加redirect { path: '/task', name: 'task', redirect: '/task/square', component: () => import('@/views/index.vue'), children:[ { name:'square', path:'square', component: () => import('@/views/task/square.vue') } ] },