Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// For Nuxtjs and Gridsome:
<template>
<div>
<div v-html="richtext"></div>
</div>
</template>
<script>
export default {
props: ['text'],
computed: {
richtext() {
return this.text ? this.$storyapi.richTextResolver.render(this.text) : ''
}
}
}
</script>
// Universal for Vuejs:
<template>
<div>
<div v-html="richtext"></div>
</div>
</template>
<script>
import Storyblok from 'storyblok-js-client'
const Api = new Storyblok()
export default {
props: ['text'],
computed: {
richtext() {
return this.text ? Api.richTextResolver.render(this.text) : ''
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment