1414The ` NotionRenderer ` component offers a few properties
1515
1616- [ ` blockMap ` ] ( #blockMap ) – required
17+ - [ ` blockOverrides ` ] ( #blockOverrides ) – default: ` {} `
1718- [ ` contentId ` ] ( #contentId ) – default: ` undefined `
1819- [ ` embedAllow ` ] ( #embedAllow ) – default: ` "fullscreen" `
1920- [ ` fullPage ` ] ( #fullPage ) – default: ` false `
2021- [ ` hideList ` ] ( #hideList ) – default: ` [] `
22+ - [ ` imageOptions ` ] ( #imageOptions ) – default: ` undefined `
2123- [ ` mapImageUrl ` ] ( #mapImageUrl ) – default: ` defaultMapImageUrl() `
2224- [ ` mapPageUrl ` ] ( #mapPageUrl ) – default: ` defaultMapPageUrl() `
2325- [ ` pageLinkOptions ` ] ( #pageLinkOptions ) – default: ` undefined `
@@ -31,6 +33,19 @@ The `NotionRenderer` component offers a few properties
3133– the blocks part of a Notion API response.
3234A list of blocks by their id that may contain contents and properties.
3335
36+ ### ` blockOverrides ` : Object
37+
38+ – the Notion blocks that should be overriden by custom registered Vue components.
39+ A key-value pair Object of Notion block names to Vue component names.
40+
41+ e.g. to use a custom ` code ` component—after registering the ` CustomCode ` Vue component—add the following override, as seen in the ` /example `
42+
43+ ``` js
44+ blockOverrides: {
45+ code: " CustomCode" ,
46+ }
47+ ```
48+
3449### ` contentId ` : String
3550
3651– the id of the block that should be rendered.
@@ -50,6 +65,23 @@ The default allows embeds to enter fullscreen.
5065
5166– a list of Notion blocks (e.g. ` "callout" ` ) that should not be rendered.
5267
68+ ### ` imageOptions ` : Object
69+
70+ – are used to override default image rendering.
71+ ` imageOptions ` is an ` Object ` that requires a ` component ` parameter.
72+ The ` src ` attribute is optional and defaults to ` src ` .
73+ Any additional key value pairs are spread onto the component as element attributes.
74+
75+ e.g. to use ` nuxt-img ` components instead of HTML ` img ` elements
76+
77+ ``` js
78+ imageOptions: {
79+ component: " nuxt-img" ,
80+ " some-attribute" : " vue-notion-attr" ,
81+ // src: 'src', // (default) can be overridden to customize the key of the `src` attribute
82+ }
83+ ```
84+
5385### ` mapImageUrl ` : Function
5486
5587– a function that receives ` (imageUrl: String, block: Object) ` and returns a ` url: String ` that should be used during rendering.
@@ -74,7 +106,8 @@ mapPageUrl(pageId = "") {
74106### ` pageLinkOptions ` : Object
75107
76108– are used to override links to other Notion pages with custom Vue components.
77- ` pageLinkOptions ` is an ` Object ` that requires a ` component ` and a ` href ` parameter.
109+ ` pageLinkOptions ` is an ` Object ` that requires a ` component ` parameter.
110+ The ` href ` attribute is optional and defaults to ` href ` .
78111
79112e.g., to use ` NuxtLink ` components instead of HTML ` a ` elements
80113
@@ -190,7 +223,7 @@ There are a few required steps to allow Nuxt to work with vue-notion
190223// nuxt.config.js
191224export default {
192225 // ...
193- buildModules: [" vue-notion/nuxt" ],
226+ buildModules: [" vue-notion/nuxt" ]
194227};
195228```
196229
0 commit comments