All guides

Vue

Mount a contact form in a Vue single-file component.

Copy your endpoint

Open your form in Wiztrom and copy its endpoint from Setup. Replace the example URL with that address. If you created your form from a template, use the field names and required fields from its Setup HTML.

Create src/components/ContactForm.vue

Keep the markup inside the template block. Omit @submit.prevent on this form so the browser follows the action.

Vue
<template>
  <form action="https://forms.wiztrom.com/f/YOUR_FORM_ID" method="post">
    <label>Name <input name="name" required /></label>
    <label>Email <input name="email" type="email" required /></label>
    <label>Message <textarea name="message" required></textarea></label>
    <button type="submit">Send message</button>
  </form>
</template>

Render ContactForm

Import the component into a page or App.vue using the script setup block below. Place <ContactForm /> in that parent component’s template and publish the app.

Vue
<script setup>
import ContactForm from './components/ContactForm.vue'
</script>

Find the test in your inbox

On the published page, leave a required field empty and try Send. Fill it in, enter a distinctive test message and submit once. Open the form’s Wiztrom inbox and match the submitted values. If you enabled a notification, open delivery history and check its result.

References