m4rvr / storyblok-rich-text-renderer

Fast renderer for your rich-text content.
35 stars 15 forks source link

feat: add propName plugin option #13

Closed hissalht closed 2 years ago

hissalht commented 2 years ago

Hello, I'm not sure if this project is still alive bu I have the same problem as https://github.com/MarvinRudolph/storyblok-rich-text-renderer/issues/10#issuecomment-933737270 so I added a propName option to change the name of the prop used to pass the storyblok data to the component (currently body).

Vue.use(RichTextRenderer, {
  propName: 'blok',
  resolvers: {
    blocks: {
      [Block.PARAGRAPH]: CustomParagraph,
    },
    components: {
      // SbButton receive a `blok` prop instead of `body`
      button: SbButton,
    },
  },
});