使用vue-router,它会让我返回到路由到/的初始组件
路由器是这样初始化的:
export default new Router({
history: true,
routes: [
{
path: '/',
name: 'BodyParent',
component: BodyParent
},
{
path: '/configuration',
name: 'Configuration',
component: Configuration
}
]
})如果我转到/configuration,它仍然会加载BodyParent组件,但是浏览器的URL最初会转到/configuration,然后转到/configuration#/,同时仍然会加载BodyParent
如果我将Configuration组件路由到/,它会呈现它。怎么会这样?
所以问题很普遍- Vue路由器默认使用设置为/的组件
发布于 2017-11-22 17:59:59
问题是我使用常规的href来导航。
我应该使用:<router-link to="Configuration">Config</router-link>
https://stackoverflow.com/questions/47430960
复制相似问题