Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement