-
Notifications
You must be signed in to change notification settings - Fork 67
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
Nested page render the default layout even set to another layout #134
Comments
This is a side effect of unplug-vue-router. You'll need to create a src/pages/nested.vue with its layout set to false to disable the top level layout. See the unplugin-vue-router example. I'm going to leave this issue open in the hopes that we can find a solution but so far I've had no luck. |
Another temporary solution without creating a new file is modifying const nestedRoute = routes.find((route) => route.path === '/nested')
if (nestedRoute) {
nestedRoute.meta = nestedRoute.meta ?? {}
nestedRoute.meta.layout = false
}
const routesWithLayouts = setupLayouts(routes) |
I'm using unplugin-vue-router.
![图片](https://private-user-images.githubusercontent.com/41231596/291028058-94e928e0-17af-4052-a4b0-7b71cf12d1cb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTA5NjAsIm5iZiI6MTczOTAxMDY2MCwicGF0aCI6Ii80MTIzMTU5Ni8yOTEwMjgwNTgtOTRlOTI4ZTAtMTdhZi00MDUyLWE0YjAtN2I3MWNmMTJkMWNiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDEwMzEwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM0MWViYWI0NTIyNzQ0ZTVmMzRlOTEzMjYxZDIzZjNiMjRhMGFiYmY1YTA4YWZjMzgzOWE4NTdhMWQ3MzYzNTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.mN3osDC0lCSRlYzac-BffmNKuyv0EGpWAC2BOHfJhcI)
![图片](https://private-user-images.githubusercontent.com/41231596/291028147-8358c3b7-9958-4d9b-8db9-b6c06c63d138.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTA5NjAsIm5iZiI6MTczOTAxMDY2MCwicGF0aCI6Ii80MTIzMTU5Ni8yOTEwMjgxNDctODM1OGMzYjctOTk1OC00ZDliLThkYjktYjZjMDZjNjNkMTM4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDEwMzEwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWEwYmY1ZGQ5NWFlMTE0MDQ5MjliOGRhODNkYjkwMTJhOWQ2NzhlMWExMTJlYzExOWU0OWNkZGZhYTMzMjAwNWImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.H_AHMQwJtVzxty3iP95wW8-dBypN5pOQ9i0NYK9V0R8)
pages and layout structure:
about.vue
andnested/index.vue
are set toalpha
layout. But they have different behavior.reproduce repo: https://github.com/Discreater/double-layout
The text was updated successfully, but these errors were encountered: