-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Improves Layout.vue for extending #1880
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
Comments
I don't think that providing too many hard-code overriding hooks is a good solution, maybe the simplest way for you is to custom a ref: https://v1.vuepress.vuejs.org/theme/option-api.html#globallayout |
Hi @ulivz, Thanks for the feedbacks. It definitely solves the the generic footer feature. However, do you think adding at least the unnamed slot for overriding do provide some value? After all the v-if home way is a hard-code and not extended thing. I'm raising the request, because I extend the default-theme, like the @vuepress/theme-vue does. Then try to add one more custom page like Home.vue does, but it's impossible to keep the navbar and make it elegant. Because the default theme Layout.vue is not designed for extending. That seems leave me to a not too good workaround: I can create a new base layout ( So my point is that if we want the default theme to be extendable. It need provide some way to achieve what Home.vue does for other Layout/component, And an unnamed slot seems the easiest way to do. Other option like adding a new frontmatter entry
|
This more like a feature request, and closed due to missing further feedbacks. |
Feature request
Restructure Layout.vue to make it easier to extend
What problem does this feature solve?
Current Layout.vue template is hard to override while keep the navbar.
What does the proposed API look like?
The home page, then can be an example of custom layout.
HomeLayout.vue
placed attheme/layouts
To enable home layout, add layout to frontmatter.
docs/README.md
How should this be implemented in your opinion?
as above.
Are you willing to work on this yourself?
The code is pretty much here. I can do it, however it's changing the base template, better a core developer can step in, or review it.
The text was updated successfully, but these errors were encountered: