File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
- import { useNuxtApp } from " #app"
3
-
4
2
const { $notion } = useNuxtApp ()
5
3
const { data } = await useAsyncData (" notion-index" , () => $notion .getPageBlocks (" 4b2dc28a5df74034a943f8c8e639066a" ))
6
4
const { mapPageUrl, pageLinkOptions } = useProps ()
Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
- import { useNuxtApp } from " #app"
3
-
4
2
const route = useRoute ()
5
3
const { $notion } = useNuxtApp ()
6
- const { data } = await useAsyncData (` notion-${route .params .id } ` , () => $notion .getPageBlocks (route .params .id ))
4
+ const { data, pending } = useLazyAsyncData (` notion-${route .params .id } ` , () =>
5
+ $notion .getPageBlocks (route .params .id .toString ())
6
+ )
7
7
const { mapPageUrl, pageLinkOptions } = useProps ()
8
8
</script >
9
9
10
10
<template >
11
- <div >
11
+ <div v-if =" pending" class =" notion" >Loading...</div >
12
+ <div v-else >
12
13
<NotionRenderer :blockMap =" data" fullPage prism katex :mapPageUrl =" mapPageUrl" :pageLinkOptions =" pageLinkOptions" />
13
14
</div >
14
15
</template >
You can’t perform that action at this time.
0 commit comments