Skip to content

Commit 3e70fa8

Browse files
committed
add sync pointer blocks
1 parent 2a01304 commit 3e70fa8

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

src/blocks/sync-block.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<script setup lang="ts"></script>
2+
3+
<template>
4+
<div class="notion-sync-block"><slot /></div>
5+
</template>
6+
7+
<script lang="ts">
8+
export default {
9+
name: "NotionSyncBlock",
10+
}
11+
</script>

src/blocks/sync-pointer-block.vue

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<script setup lang="ts">
2+
import { computed } from "vue"
3+
import { useNotionBlock, defineNotionProps } from "@/lib/blockable"
4+
import NotionRenderer from "@/components/notion-renderer.vue"
5+
6+
const props = defineProps({ ...defineNotionProps })
7+
//@ts-ignore
8+
const { block, pass } = useNotionBlock(props)
9+
10+
const referencePointerId = computed(() => block.value.value.format?.transclusion_reference_pointer?.id ?? "")
11+
</script>
12+
13+
<template>
14+
<NotionRenderer
15+
v-bind="pass"
16+
:key="referencePointerId"
17+
:level="pass.level + 1"
18+
:content-id="referencePointerId"
19+
:content-index="contentIndex"
20+
></NotionRenderer>
21+
</template>
22+
23+
<script lang="ts">
24+
export default {
25+
name: "NotionSyncPointerBlock",
26+
}
27+
</script>

0 commit comments

Comments
 (0)