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

useStoryblokRichText.render() rendering VNode instead of HTML #745

Open
1 task done
codeflorist opened this issue Oct 3, 2024 · 0 comments
Open
1 task done

useStoryblokRichText.render() rendering VNode instead of HTML #745

codeflorist opened this issue Oct 3, 2024 · 0 comments
Labels
pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised

Comments

@codeflorist
Copy link

Describe the issue you're facing

I'm trying to use useStoryblokRichText. In the docs the following example is stated:

<script setup>
  ...

  const { render } = useStoryblokRichText({
    resolvers,
  })

  const html = render(blok.articleContent);
</script>

<template>
  <div v-html="html"></div>
</template>

This however only outputs [object Object], since the render-function returns a VNode instead of rendered html.

Imho the correct solution would be:

<script setup>
  ...

  const { render } = useStoryblokRichText({
    resolvers,
  })

  const RichTextVNode = render(blok.articleContent);
</script>

<template>
  <RichTextVNode />
</template>

Reproduction

https://stackblitz.com/edit/vitejs-vite-j1rudk?file=src%2Fpages%2FHome.vue

Steps to reproduce

No response

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm

Used Package Manager

npm

Error logs (Optional)

No response

Validations

@codeflorist codeflorist added pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised labels Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised
Projects
None yet
Development

No branches or pull requests

1 participant