-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Default Theme Slots do not allow customization for the sidebar or page #1950
Default Theme Slots do not allow customization for the sidebar or page #1950
Comments
I've started a PR here with the fixes, I would love feedback since this is my first PR against the project #1951 |
I've encountered the same issue when passing content to slots of parent-theme components. Your changes in PR #1915 are working. Previously: <template>
<div
class="theme-container"
:class="pageClasses"
@touchstart="onTouchStart"
@touchend="onTouchEnd"
>
<Navbar v-if="shouldShowNavbar" @toggle-sidebar="toggleSidebar" />
<div class="sidebar-mask" @click="toggleSidebar(false)"></div>
<Sidebar :items="sidebarItems" @toggle-sidebar="toggleSidebar">
<slot name="sidebar-top" #top />
<slot name="sidebar-bottom" #bottom />
</Sidebar>
<Home v-if="$page.frontmatter.home" />
<Page v-else :sidebar-items="sidebarItems">
<slot name="page-top" #top />
<slot name="page-bottom" #bottom />
</Page>
</div>
</template> Now: <template>
<div
class="theme-container"
:class="pageClasses"
@touchstart="onTouchStart"
@touchend="onTouchEnd"
>
<Navbar v-if="shouldShowNavbar" @toggle-sidebar="toggleSidebar" />
<div class="sidebar-mask" @click="toggleSidebar(false)"></div>
<Sidebar :items="sidebarItems" @toggle-sidebar="toggleSidebar">
<slot name="sidebar-top" slot="top" />
<slot name="sidebar-bottom" slot="bottom" />
</Sidebar>
<Home v-if="$page.frontmatter.home" />
<Page v-else :sidebar-items="sidebarItems">
<slot name="page-top" slot="top" />
<slot name="page-bottom" slot="bottom" />
</Page>
</div>
</template> However, I've also tried the syntax shown in Access Parent Theme. There seems to be an issue too: Like the example in vuepress docs (not working): <template>
<ParentLayout>
<Foo #page-top />
<template slot="page-bottom">
<span>Test</span>
</template>
</ParentLayout>
</template> Using templates (working): <template>
<ParentLayout>
<template #page-top>
<Foo />
</template>
<template slot="page-bottom">
<span>Test</span>
</template>
</ParentLayout>
</template> |
@sabicalija is there something else that I need to do to get those changes merged into master? I'm not sure what the workflow is for this project. |
@softwarewright Sorry, but I don't know that, unfortunately. I guess @ulivz will reply as soon as possible. In the meantime, we can customize the |
Bug report
Steps to reproduce
Attempt to override the sidebar or page top/bottom in the theme for a project
What is expected?
The using the slots should update the content on the sidebar and the page.
What is actually happening?
Nothing is being rendered
Other relevant information
There needs to be templates wrapped around the slots on the Layout.vue in the vue default theme for the page and the sidebar sections.
The text was updated successfully, but these errors were encountered: