feat: top and bottom slots for sidebar and page (#90)

pull/83/head
Eduardo San Martin Morote 4 years ago committed by GitHub
parent 725a04cdf0
commit 11060136c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,7 +5,14 @@
<ToggleSideBarButton @toggle="toggleSidebar" /> <ToggleSideBarButton @toggle="toggleSidebar" />
</header> </header>
<aside :class="{ open }"> <aside :class="{ open }">
<SideBar/> <SideBar>
<template #top>
<slot name="sidebar-top" />
</template>
<template #bottom>
<slot name="sidebar-bottom" />
</template>
</SideBar>
</aside> </aside>
<div <div
class="sidebar-mask" class="sidebar-mask"
@ -13,7 +20,14 @@
@click="toggleSidebar(false)" @click="toggleSidebar(false)"
/> />
<main> <main>
<Page /> <Page>
<template #top>
<slot name="page-top" />
</template>
<template #bottom>
<slot name="page-bottom" />
</template>
</Page>
</main> </main>
</div> </div>
<Debug /> <Debug />

@ -1,8 +1,10 @@
<template> <template>
<div class="content"> <div class="content">
<slot name="top" />
<Content /> <Content />
<NextAndPrevLinks /> <NextAndPrevLinks />
<PageEdit /> <PageEdit />
<slot name="bottom" />
</div> </div>
</template> </template>
@ -10,7 +12,7 @@
import NextAndPrevLinks from './NextAndPrevLinks.vue' import NextAndPrevLinks from './NextAndPrevLinks.vue'
import PageEdit from './PageEdit.vue' import PageEdit from './PageEdit.vue'
export default { export default {
components:{ NextAndPrevLinks, PageEdit } components: { NextAndPrevLinks, PageEdit }
} }
</script> </script>
@ -18,6 +20,7 @@ export default {
.content { .content {
margin: 0 auto; margin: 0 auto;
padding: 0.025rem 2.5rem 2rem; padding: 0.025rem 2.5rem 2rem;
/* if this is moved to a variable, add it to BuySellAds.vue */
max-width: 50rem; max-width: 50rem;
} }

@ -1,9 +1,13 @@
<template> <template>
<NavBarLinks class="show-mobile" /> <NavBarLinks class="show-mobile" />
<slot name="top" />
<ul class="sidebar"> <ul class="sidebar">
<SideBarItem v-for="item of items" :item="item" /> <SideBarItem v-for="item of items" :item="item" />
</ul> </ul>
<slot name="bottom" />
</template> </template>
<script src="./SideBar"></script> <script src="./SideBar"></script>

Loading…
Cancel
Save