我对Vue中的默认 children 路由有问题.js 2.
当我最初访问localhost/listings时,它会正确地加载索引.vue和 map .小时候的vue.
当我使用路由链接导航到localhost/listings/1,然后使用路由链接返回到localhost/listings时,它仍然会加载节目.vue模板.This shouldn't happen?
我没有导航装置或任何干扰.有没有办法纠正这个问题?
我的路由:
window.router = new VueRouter({
routes: [
...
{
path: '/listings',
name: 'listing.index',
component: require('./components/listing/index.vue'),
children: [
{
path: '',
component: require('./components/listing/map.vue')
},
{
path: ':id',
name: 'listing.show',
component: require('./components/listing/show.vue')
}
]
},
...
]
});