Skip to content

Commit

Permalink
feat: add VBlock
Browse files Browse the repository at this point in the history
timothejoubert committed Jun 11, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 61e8eca commit 3ec6350
Showing 2 changed files with 33 additions and 0 deletions.
18 changes: 18 additions & 0 deletions components/atoms/VBlock/Default.stories.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script setup lang="ts">
const walker = {
'@id': '',
'@type': '',
item: {
slug: 'block-slug',
},
children: [],
}
</script>

<template>
<NuxtStory>
<VBlock :item="walker.item">
<h1>Contenu du block</h1>
</VBlock>
</NuxtStory>
</template>
15 changes: 15 additions & 0 deletions components/atoms/VBlock/VBlock.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script lang="ts" setup>
import type { RoadizNodesSources } from '@roadiz/types'
export type VBlockProps = {
item?: RoadizNodesSources
tag?: string
}
defineProps<VBlockProps>()
</script>
<template>
<component :is="tag || 'section'" :id="item?.slug">
<slot />
</component>
</template>

0 comments on commit 3ec6350

Please sign in to comment.