Skip to content

Instantly share code, notes, and snippets.

@a-h
Last active November 22, 2023 10:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a-h/e7450ea6adad91394431ea87cf9f83db to your computer and use it in GitHub Desktop.
Save a-h/e7450ea6adad91394431ea87cf9f83db to your computer and use it in GitHub Desktop.
slidev two columns with header layout
<!--
Usage:
```md
---
layout: two-cols-header
---
This shows up across both
::left::
# Left
This shows on the left
::right::
# Right
This shows on the right
```
-->
<script setup lang="ts">
const props = defineProps({
class: {
type: String,
},
})
</script>
<template>
<div class="slidev-layout two-columns w-full h-full">
<div class="col-span-2">
<slot />
</div>
<div class="grid grid-cols-2 grid-rows-2">
<div class="col-left" :class="props.class">
<slot name="left" />
</div>
<div class="col-right" :class="props.class">
<slot name="right" />
</div>
</div>
</div>
</template>
@a-h
Copy link
Author

a-h commented Sep 13, 2022

Add the file as layouts/two-cols-header.vue

See https://github.com/slidevjs/slidev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment