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

SB Components with underscores not rendered in Nuxt/Vue #99

Open
uuf6429 opened this issue Jun 24, 2022 · 5 comments
Open

SB Components with underscores not rendered in Nuxt/Vue #99

uuf6429 opened this issue Jun 24, 2022 · 5 comments
Labels
feature [Issue] New feature or request

Comments

@uuf6429
Copy link

uuf6429 commented Jun 24, 2022

What I tried:

  • forked the demo at https://stackblitz.com/edit/nuxt-3-sdk-demo
  • connected it to my account (by updating the auth key)
  • tried it out with the default call_to_action SB components, but it didn't work(*)
  • so I tried it my own custom SB component called "bold", and that worked

(*) tried creating vue/nuxt component named CallToAction.vue, call_to_action.vue and other variants

After some digging, I think the problem is basically here:

<component :is="blok.component" v-bind="{ ...$props, ...$attrs }"></component>

From my understanding, SB does not allow component names with dashes, while on the other hand Vue/Nuxt does not like components with underscores.

So my (perhaps naive) suggestion would be to replace the code above with (which replaces underscores with dashes):

  <component :is="blok.component.replace(/_/g, '-')" v-bind="{ ...$props, ...$attrs }"></component>
@bootsmann1995
Copy link

I'm runnig in to the same issue, is there a roadmap on when this is fixed?

@alvarosabu
Copy link
Contributor

Hi, @uuf6429 and @bootsmann1995 sorry that it took so long to get answered, I would ask if this issue is still valuable so I can prioritize it.

Thanks

@uuf6429
Copy link
Author

uuf6429 commented May 24, 2024

We gave up on that a long time ago and switched to a PHP implementation.

@alvarosabu
Copy link
Contributor

Sorry to hear that @uuf6429

@reneroth
Copy link

Hi, @uuf6429 and @bootsmann1995 sorry that it took so long to get answered, I would ask if this issue is still valuable so I can prioritize it.

Thanks

+1 from me, this bug caused issues for me before, would be grateful for a fix.

We gave up on that a long time ago and switched to a PHP implementation.

my condolences 😛

@alvarosabu alvarosabu added feature [Issue] New feature or request and removed enhancement labels Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature [Issue] New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants