Using a typeform in a component with Vuex | Community
Skip to main content
Answered

Using a typeform in a component with Vuex


Hello I am trying to embed the typeform code on a component using Vuex… the problem is that I have to put everything into a <template></template> but I can’t put a <script> tag inside a template tag… I also try to write the “src” inside the script tag after template tag but it doesn’t work…

 

<template>
<div>
  <div 
    data-tf-widget="xVQWIlXA" 
    data-tf-iframe-props="title=Newsletter Sa-tour-now" 
    data-tf-medium="snippet" 
    style="width:100%;height:400px;">
  </div>
</div>
</template>

<script src="//embed.typeform.com/next/embed.js">

export default {
  name: 'TypeForm',
}
</script>

 

Best answer by Liz

Hi @jesupet I’m afraid that might be the case if the builder can’t accept Javascript. :\ I don’t believe we would have a workaround for this, but @mathio can confirm this!

View original

3 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 15035 replies
  • May 18, 2022

Hi @jesupet Happy Wednesday! While I’m not familiar with Vuex, if the platform has a limitation that removes the ‘script’ portion of the code, the form won’t appear because it needs this in order to run. 

You could try just putting the Typeform URL into an iFrame like this: 

<iframe src = yourtypeformurlhere.com. /> 

I can’t guarantee this will work, but it’s a worth a try!


  • Author
  • Explorer
  • 1 reply
  • May 18, 2022

HI Liz, I try it, but it didn’t work. I attach a picture bellow. This is what I see in the browser instead of the form...

 


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 15035 replies
  • Answer
  • May 18, 2022

Hi @jesupet I’m afraid that might be the case if the builder can’t accept Javascript. :\ I don’t believe we would have a workaround for this, but @mathio can confirm this!