Can't render content via v-html from script

189 views Asked by At

How do I render the script that this.item.content returns?

If I get HTML code then it renders properly, but if I get some script that should render some piece of HTML, it does not render it. The script should render some form.

Is the v-html problem here or is there something else?

<template>
 <div v-html="htmlContent"></div>
</template>
<script>
  import { Blok } from 'src/modules/storyblok/components'
  import { htmlDecode } from '@vue-storefront/core/filters'

export default {
  name: 'CustomHtml',
  extends: Blok,
  data () {
    return {
      htmlContent: this.item.content
    }
  },
  mounted () {
  this.htmlContent = htmlDecode(this.item.content)
  }
} 
</script>

I cannot share the whole script, but this is the example of the one that should render.

<script src="//r1.dotdigital-pages.com/resources/sharing/embed.js" data-sharing="lp-embed" 
data-page-domain="r1.dotdigital-pages.com"></script>
0

There are 0 answers