解决 Vue 默认路由有斜杠后缀的问题?
测试版本: vue: 2.6.12 vue-router: 3.4.7
const routes = [
{
path: '/home'
component: Layout,
children: [
{
path: '/home',
name: 'homeindex'
component: () => import('@/views/home/index.vue')
}
]
}
]
参考
- https://stackoverflow.com/questions/58130594/vuerouter-default-child-route-without-trailing-slash#:~:text=VueRouter always adds a trailing slash before the ,%27%3Aaid%27%2C%20component%3A%20HomeArticle%2C%20name%3A%20%27home.article%27%20%7D%20%5D%20%5D

浙公网安备 33010602011771号