{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-embeds/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Embedding forms in Vue","description":"Build integrations, automate workflows, and manage forms and responses programmatically with the forms.app API.","siteUrl":"https://developers.forms.app","image":"/assets/formsapp-developer-docs.6ffba4f5ff7d394698661bcdb0ed2a8452f27acaf4e82754e5d0f4109563471c.9c1bb791.png","lang":"en-US","projectTitle":"forms.app Developer Docs","llmstxt":{"sections":[{"title":"llmtxt for forms app documents","includeFiles":["**/*"],"excludeFiles":[]}]},"jsonLd":{"@context":"https://schema.org","@type":"Organization","additionalType":"https://en.wikipedia.org/wiki/Software_as_a_service","url":"https://forms.app","name":"forms.app","logo":"https://cdn.forms.app/icons/all/brands/formsapp-logo-dark.svg","description":"forms.app is a free online form builder designed for teams. forms.app offers a modern, easy-to-use form builder and allows unlimited responses and team members.","foundingDate":"2018","sameAs":"https://linkedin.com/company/formsapp","contactPoint":{"@type":"ContactPoint","contactType":"Customer service","email":"support@forms.app","url":"https://forms.app/en/contact-us"}}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"embedding-forms-in-vue","__idx":0},"children":["Embedding forms in Vue"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Examples use the Composition API with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<script setup>"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"iframe-embed","__idx":1},"children":["Iframe embed"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"vue","header":{"controls":{"copy":{}}},"source":"<template>\n  <iframe\n    title=\"Cake Order Form\"\n    src=\"https://eu.forms.app/form/69d4bd130b443bda40c8f65a\"\n    allowtransparency=\"true\"\n    allowfullscreen=\"true\"\n    allow=\"geolocation; microphone; camera\"\n    style=\"width: 100vw; min-width: 100%; height: 600px; border: none;\"\n  />\n</template>\n","lang":"vue"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"script-embed","__idx":2},"children":["Script embed"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Load ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["embed.js"]}," once, in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onMounted"]},", then call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["new window.formsapp(...)"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"vue","header":{"controls":{"copy":{}}},"source":"<script setup>\nimport { onMounted } from 'vue';\n\nfunction loadFormsAppScript() {\n  return new Promise((resolve) => {\n    if (window.formsapp) {\n      resolve();\n      return;\n    }\n    const existing = document.querySelector('script[src=\"https://cdn.formsapp.io/embed.js\"]');\n    if (existing) {\n      existing.addEventListener('load', () => resolve());\n      return;\n    }\n    const script = document.createElement('script');\n    script.src = 'https://cdn.formsapp.io/embed.js';\n    script.async = true;\n    script.defer = true;\n    script.onload = () => resolve();\n    document.body.appendChild(script);\n  });\n}\n\nonMounted(async () => {\n  await loadFormsAppScript();\n  new window.formsapp(\n    '69d4bd130b443bda40c8f65a',\n    'sidetab',\n    {\n      button: { color: '#ff9e24', text: 'Click here!' },\n      align: { horizontal: 'right', vertical: 'middle' },\n      width: '400px',\n      height: '500px',\n    },\n    'https://eu.forms.app',\n  );\n});\n</script>\n\n<template>\n  <!-- The side tab creates its own trigger; no placeholder element is needed. -->\n</template>\n","lang":"vue"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"passing-data-from-a-route-query-parameter","__idx":3},"children":["Passing data from a route query parameter"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Combine ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["loadFormsAppScript"]}," above with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["vue-router"]}," and the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["answers"]}," option from ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/embeds/passing-form-data"},"children":["Passing data to your form"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"vue","header":{"controls":{"copy":{}}},"source":"<script setup>\nimport { onMounted } from 'vue';\nimport { useRoute } from 'vue-router';\n\nconst route = useRoute();\n\nonMounted(async () => {\n  await loadFormsAppScript();\n  new window.formsapp(\n    '69d4bd130b443bda40c8f65a',\n    'standard',\n    {\n      width: '100vw',\n      height: 'formHeight',\n      answers: { '63ebad419442ad0448b9e9b6': route.query.ref ?? '' },\n    },\n    'https://eu.forms.app',\n  );\n});\n</script>\n\n<template>\n  <div data-formsapp-src=\"https://eu.forms.app/form/69d4bd130b443bda40c8f65a\" />\n</template>\n","lang":"vue"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"whats-next","__idx":4},"children":["What's next"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/embeds/examples/react"},"children":["React"]}," for the equivalent React patterns."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/embeds/embed-options"},"children":["Embed options"]}," for every layout's settings."]}]}]},"headings":[{"value":"Embedding forms in Vue","id":"embedding-forms-in-vue","depth":1},{"value":"Iframe embed","id":"iframe-embed","depth":2},{"value":"Script embed","id":"script-embed","depth":2},{"value":"Passing data from a route query parameter","id":"passing-data-from-a-route-query-parameter","depth":2},{"value":"What's next","id":"whats-next","depth":2}],"frontmatter":{"seo":{"title":"Embedding forms in Vue"}},"lastModified":"2026-08-18T10:33:31.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/embeds/examples/vue","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}