Skip to content

Instantly share code, notes, and snippets.

@SidneyAllen
Last active October 29, 2021 18:15
Show Gist options
  • Save SidneyAllen/ec7916f2120f5f7be2d9eb13e3c55f0a to your computer and use it in GitHub Desktop.
Save SidneyAllen/ec7916f2120f5f7be2d9eb13e3c55f0a to your computer and use it in GitHub Desktop.
// src/components/Front.vue
<script setup>
import router from "../router";
...
const templateName = ref("")
async function submitTemplate() {
await fetch(`http://localhost:3030/templates/create?logoText=${logoText.value}&templateName=${templateName.value}&backgroundImage=${imgSrc.value}&description=${headerText.value}`, { method: "POST" })
router.push("/list")
}
</script>
<template>
...
<div>
<h2>Finished with your postcard design?</h2>
<div class="form-field">
<label for="templateName">Give it a name</label>
<input id="templateName" v-model="templateName" />
</div>
<button @click="submitTemplate()">Upload template</button>
</div>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment