Skip to content
New issue

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

How to change the attrs prop name #22

Open
avaldevilap opened this issue Jun 21, 2022 · 6 comments
Open

How to change the attrs prop name #22

avaldevilap opened this issue Jun 21, 2022 · 6 comments

Comments

@avaldevilap
Copy link

avaldevilap commented Jun 21, 2022

In my current project, we're already using the prop name of blok. There's any way in the configuration for changing the prop attrs by blok?

<template>
  <div v-editable="blok" class="divider" />
</template>

<script>
export default {
  props: {
    blok: {
      type: Object,
      required: true,
    },
  },
};
</script>
@SebbeJohansson
Copy link

Hi. Did you create this issue in the wrong repo? This is specifically for the rich-text-renderer that @m4rvr has created. From your comment, it looks like you are talking about the storyblok components rather than the renderer?

@avaldevilap
Copy link
Author

I'm having trouble rendering components inside of rich text renderer

@SebbeJohansson
Copy link

@avaldevilap Wouldnt that be related to these?
#15
#6

@DEV-ONI
Copy link

DEV-ONI commented Jun 23, 2022

I'm having the same issue.

The problem is the prop is passed as attrs described in the first part of https://storyblok-rich-text-renderer.netlify.app/vue-plugin/resolvers/: (Every component gets an attrs prop value which contains the attributes (if there are any) from Storyblok like the level of your HEADING or the src of your IMAGE. ✌️)

so if your accepts a prop blok instead of a prop named attrs, you get an error that the component expects a prop named blok

We're wondering if there's a way to change the prop name passed to components that wouldn't require a rewrite to adhere to just this plugin.

@jony1993
Copy link

We're having the same issue.
Has anyone already found a workaround? :)

@SebbeJohansson
Copy link

@jony1993 i managed to work around the issue of rendering components in richtext with this solution:
https://gist.github.com/SebbeJohansson/31b64c5c4f914abfec2660210ec7795a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants