我遇到Vue Router问题。我想使用带有city
名称的动态路由,country
名称具有相同的baselug:/explore/
,例如:/explore/canada
和/explore/los-angeles
所以我做了我的路由器:
export const explore = {
path: '/explore',
component: Home,
children: [
// Single Location
{
path: ':country_name',
component: CountryPage,
name: 'CountryRoute'
},
{
path: ':city_name',
component: CityPage,
name: 'CityRoute'
}
]
}
使用路由器时:
<router-link :to="{ name: 'CityRoute', params: { city_name: users.live_in.slug }}">
没关系,但是当我按F5重新加载时,得到错误:
Request failed with status code 404