-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jlpereira
committed
Sep 4, 2023
1 parent
d78ace1
commit 22587b7
Showing
3 changed files
with
40 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| <template> | ||
| <component | ||
| :is="tag" | ||
| :class="layoutClasses" | ||
| > | ||
| <slot /> | ||
| </component> | ||
| </template> | ||
|
|
||
| <script setup> | ||
| import { computed } from 'vue' | ||
| const props = defineProps({ | ||
| tag: { | ||
| type: String, | ||
| default: 'div' | ||
| }, | ||
| frontmatter: { | ||
| type: Object, | ||
| required: true | ||
| } | ||
| }) | ||
| const LAYOUT_CLASSES = { | ||
| fullwidth: 'p-4 sm:px-0 prose dark:prose-invert max-w-none' | ||
| } | ||
| const DEFAULT_LAYOUT = | ||
| '!container mx-auto p-4 sm:px-0 prose dark:prose-invert box-border' | ||
| const layoutClasses = computed( | ||
| () => LAYOUT_CLASSES[props.frontmatter.layout] || DEFAULT_LAYOUT | ||
| ) | ||
| </script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters