Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

父子路由配置 #48

Open
alanhe421 opened this issue May 29, 2018 · 1 comment
Open

父子路由配置 #48

alanhe421 opened this issue May 29, 2018 · 1 comment

Comments

@alanhe421
Copy link
Owner

alanhe421 commented May 29, 2018

通过父子路由配置,可以将视图页面结构构造成树结构

@alanhe421
Copy link
Owner Author

alanhe421 commented May 29, 2018

show code

{
            path: 'docs',
            children: [
                {
                    path: '', component: DocsComponent
                },
                {
                    path: ':id', component: DocDetailComponent
                }
            ]
        }

错误配置

        {
            path: 'docs', component: DocsComponent,
            children: [
                {
                    path: ':id', component: DocDetailComponent
                }
            ]
        },

按照错误配置,当链接地址为/docs/id,实际上视图是不会切换的。子路由配置,一定要确保有path=""的配置。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant