File tree Expand file tree Collapse file tree 4 files changed +47
-1
lines changed Expand file tree Collapse file tree 4 files changed +47
-1
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,10 @@ import Vue from "vue";
2
2
import Dev from "./serve.vue" ;
3
3
4
4
import VueKatex from "vue-katex" ;
5
+ import { NotionRenderer } from "@/entry" ;
5
6
6
7
Vue . use ( VueKatex ) ;
8
+ Vue . component ( "NotionRenderer" , NotionRenderer ) ;
7
9
8
10
Vue . config . productionTip = false ;
9
11
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export default {
22
22
async created () {
23
23
// react-notion tester: 2e22de6b770e4166be301490f6ffd420
24
24
// equation tester: 2a1d5226d68246deba627012081693f9
25
+ // sync tester: c10e1556bec44f23a20f71497b3d98c4
25
26
// table tester: bd1de400a8b349dc824f4f00e61d0797
26
27
// todo tester: 235057194b954a60ace89c052a65d102
27
28
this .blockMap = await getPageBlocks (" 2e22de6b770e4166be301490f6ffd420" );
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <NotionRenderer
3
+ v-bind =" pass"
4
+ :blockMap =" blockMap"
5
+ :contentId =" referencePointerId"
6
+ />
7
+ </template >
8
+
9
+ <script >
10
+ import { Blockable , blockComputed } from " @/lib/blockable" ;
11
+
12
+ export default {
13
+ extends: Blockable,
14
+ name: " NotionSyncPointer" ,
15
+ computed: {
16
+ ... blockComputed,
17
+ referencePointerId () {
18
+ return this .format ? .transclusion_reference_pointer ? .id ;
19
+ },
20
+ },
21
+ };
22
+ < / script>
Original file line number Diff line number Diff line change 40
40
v-bind =" pass"
41
41
/>
42
42
<NotionTable v-else-if =" isType('table')" v-bind =" pass" ><slot /></NotionTable >
43
+ <NotionSyncPointer
44
+ v-else-if =" isRendererRegistered && isType('transclusion_reference')"
45
+ v-bind =" pass"
46
+ />
47
+ <div
48
+ v-else-if =" isRendererRegistered && isType('transclusion_container')"
49
+ class =" notion-sync-block"
50
+ >
51
+ <slot />
52
+ </div >
43
53
<NotionTableRow v-else-if =" isType('table_row')" v-bind =" pass" />
44
54
<hr v-else-if =" isType('divider')" class =" notion-hr" />
45
55
<div v-else-if =" todo && visible" >
51
61
</template >
52
62
53
63
<script >
54
- import { Blockable } from " @/lib/blockable" ;
64
+ import Vue from " vue" ;
65
+
66
+ import { Blockable , blockComputed } from " @/lib/blockable" ;
55
67
56
68
import NotionBookmark from " @/blocks/bookmark" ;
57
69
import NotionCallout from " @/blocks/callout" ;
@@ -63,6 +75,7 @@ import NotionHeader from "@/blocks/header";
63
75
import NotionList from " @/blocks/list" ;
64
76
import NotionPage from " @/blocks/page" ;
65
77
import NotionQuote from " @/blocks/quote" ;
78
+ import NotionSyncPointer from " @/blocks/sync-pointer" ;
66
79
import NotionTable from " @/blocks/table" ;
67
80
import NotionTableRow from " @/blocks/table-row" ;
68
81
import NotionText from " @/blocks/text" ;
@@ -78,16 +91,24 @@ export default {
78
91
NotionCode,
79
92
NotionColumn,
80
93
NotionEquation,
94
+ NotionEquation,
81
95
NotionFigure,
82
96
NotionHeader,
83
97
NotionList,
84
98
NotionPage,
85
99
NotionQuote,
100
+ NotionSyncPointer,
86
101
NotionTable,
87
102
NotionTableRow,
88
103
NotionText,
89
104
NotionTodo,
90
105
NotionToggle,
91
106
},
107
+ computed: {
108
+ ... blockComputed,
109
+ isRendererRegistered () {
110
+ return " NotionRenderer" in Vue? .options ? .components ;
111
+ },
112
+ },
92
113
};
93
114
< / script>
You can’t perform that action at this time.
0 commit comments