Last active
October 12, 2019 11:40
-
-
Save onefriendaday/eaa570392851141bb709fce26ebfed42 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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