Skip to content

Instantly share code, notes, and snippets.

@onefriendaday
Last active October 12, 2019 11:40
Show Gist options
  • Save onefriendaday/eaa570392851141bb709fce26ebfed42 to your computer and use it in GitHub Desktop.
Save onefriendaday/eaa570392851141bb709fce26ebfed42 to your computer and use it in GitHub Desktop.
// 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