You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<img src="https://img.shields.io/twitter/url?label=Follow&style=social&url=https%3A%2F%2Ftwitter.com%2Fjanniksco" alt="Follow on Twitter" />
30
30
</a>
31
31
</p>
32
32
33
33
---
34
34
35
-
A Vue renderer for Notion pages.
36
-
Use Notion as CMS for your blog, documentation or personal site.
37
-
38
-
Also check out [react-notion](https://github.com/splitbee/react-notion) (developed by [Splitbee 🐝](https://splitbee.io/) – a fast, reliable, free, and modern analytics for any team)
39
-
40
-
This package doesn't handle the communication with the API. Check out [notion-api-worker](https://github.com/splitbee/notion-api-worker) from [Splitbee](https://splitbee.io/) for an easy solution.
41
-
42
-
<sub>Created by <ahref="https://twitter.com/jnnksbrt">Jannik Siebert</a></sub>
43
-
44
35
## Features
45
36
46
37
🎯 **Accurate** – Results are _almost_ identical
@@ -53,30 +44,25 @@ This package doesn't handle the communication with the API. Check out [notion-ap
53
44
54
45
## Install
55
46
47
+
> **Warning**
48
+
> This is the documentation for the upcoming Vue 3 compatible release of vue-notion.
49
+
> For the Vue 2 version, check out the [vue2 branch](https://github.com/janniks/vue-notion/tree/vue2).
50
+
56
51
### Vue
57
52
58
53
```bash
59
-
npm install vue-notion
54
+
npm install vue-notion@3.0.0-beta.1
60
55
```
61
56
62
57
### NuxtJS Module
63
58
64
-
Install as a dev-dependency and add `"vue-notion/nuxt"` to the `buildModules` array in `nuxt.config.js`.
65
-
66
-
```bash
67
-
npm install vue-notion --save-dev
68
-
```
69
-
70
-
```js
71
-
// nuxt.config.js
72
-
exportdefault {
73
-
// ...
74
-
buildModules: ["vue-notion/nuxt"],
75
-
};
76
-
```
59
+
Check out the `/example` folder for a full working example using Nuxt 3.
77
60
78
61
## Docs
79
62
63
+
> **Note**
64
+
> Potentially outdated -- 3.0.0 docs are a work-in-progress
This example is a part of [`example/`](https://github.com/janniks/vue-notion/tree/main/example) and is hosted at [vue-notion.now.sh/nuxt](https://vue-notion.now.sh/nuxt).
116
+
The page assumes a Nuxt plugin in `~/plugins/vue-notion.js` that registers via the `useNuxtApp` hook.
129
117
130
118
```vue
131
119
<template>
132
120
<NotionRenderer :blockMap="blockMap" fullPage />
133
121
</template>
134
122
135
-
<script>
136
-
export default {
137
-
data: () => ({ blockMap: null }),
138
-
async asyncData({ $notion }) {
139
-
// use Notion module to get Notion blocks from the API via a Notion pageId
140
-
const blockMap = await $notion.getPageBlocks(
141
-
"8c1ab01960b049f6a282dda64a94afc7"
142
-
);
143
-
return { blockMap };
144
-
},
145
-
};
123
+
<script lang="ts" setup>
124
+
const { $notion } = useNuxtApp();
125
+
126
+
// use Notion module to get Notion blocks from the API via a Notion pageId
0 commit comments