We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi there,
I need to override a Resolver for NodeTypes.CODE_BLOCK to add a component with a specific class no-prose and Highlight it with Prism.
NodeTypes.CODE_BLOCK
no-prose
So following the config options I'm trying like this:
import { plugin } from '@marvr/storyblok-rich-text-vue-renderer' import { NodeTypes } from '@marvr/storyblok-rich-text-types' export default defineNuxtPlugin(nuxtApp => { nuxtApp.vueApp.use( plugin({ resolvers: { components: { [NodeTypes.CODE_BLOCK]: ({ children, attrs }) => h('pre', attrs, h('code', { class: "no-prose" } , children)), }, }, }), ) })
But I get an Invalid vnode type when creating vnode: undefined.
Invalid vnode type when creating vnode: undefined.
How can I add a custom component for the resolver?
Thanks
The text was updated successfully, but these errors were encountered:
Hi,
just for documentation's sake. I guess you already got this:
import { plugin } from '@marvr/storyblok-rich-text-vue-renderer' import { NodeTypes } from '@marvr/storyblok-rich-text-types' import { defaultResolvers } from '@marvr/storyblok-rich-text-vue-renderer'; defaultResolvers[NodeTypes.CODE_BLOCK] = ({ children, attrs }) => h('pre', attrs, h('code', { class: "no-prose" } , children)), const resolvers = { ...defaultResolvers, components: { SomeCustomVueComponentIfAny } }; export default defineNuxtPlugin(nuxtApp => { nuxtApp.vueApp.use( plugin({ resolvers }), ) })
Components are for Vue components.
Sorry, something went wrong.
No branches or pull requests
Hi there,
I need to override a Resolver for
NodeTypes.CODE_BLOCK
to add a component with a specific classno-prose
and Highlight it with Prism.So following the config options I'm trying like this:
But I get an
Invalid vnode type when creating vnode: undefined.
How can I add a custom component for the resolver?
Thanks
The text was updated successfully, but these errors were encountered: