m4rvr / storyblok-rich-text-renderer

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

fix: allow custom components via plugin options #15

Open alvarosabu opened 2 years ago

alvarosabu commented 2 years ago

Describe issue

Passing custom resolvers for bloks inside via the plugin was overwriting the rest of default resolvers, causing errors.

Also, custom resolvers where not rendered

import CustomComponent from './components/CustomComponent.vue';
...
app.use(plugin({
  resolvers: {
    components: {
      'custom-component': () => h(CustomComponent)
    }
  }
}));

Solution

This PR adds a condition to add defaultResolvers when options.resolvers is passed to createRenderer