SHARE
TWEET

Untitled

a guest Oct 22nd, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // For Nuxtjs and Gridsome:
  2. <template>
  3.   <div>
  4.     <div v-html="richtext"></div>
  5.   </div>
  6. </template>
  7.  
  8. <script>
  9. export default {
  10.   props: ['text'],
  11.   computed: {
  12.     richtext() {
  13.       return this.text ? this.$storyapi.richTextResolver.render(this.text) : ''
  14.     }
  15.   }
  16. }
  17. </script>
  18.  
  19. // Universal for Vuejs:
  20. <template>
  21.   <div>
  22.     <div v-html="richtext"></div>
  23.   </div>
  24. </template>
  25.  
  26. <script>
  27. import Storyblok from 'storyblok-js-client'
  28. const Api = new Storyblok()
  29.  
  30. export default {
  31.   props: ['text'],
  32.   computed: {
  33.     richtext() {
  34.       return this.text ? Api.richTextResolver.render(this.text) : ''
  35.     }
  36.   }
  37. }
  38. </script>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top