Last active
October 29, 2021 18:21
-
-
Save SidneyAllen/d69196bf14220b852980acb7932b5202 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/components/ListTemplates.vue | |
<script setup> | |
import { reactive, onMounted } from "vue"; | |
const templates = reactive({}); | |
onMounted(() => { | |
fetch("http://localhost:3030/templates") | |
.then((data) => data.json()) | |
.then((data) => (templates.value = data)); | |
}); | |
</script> | |
<template> | |
<ul class="flex"> | |
<li v-for="template in templates.value"> | |
<h3>{{ template.description }}</h3> | |
<p>Created on {{ template.date_created }}.</p> | |
<p><a :href="'https://dashboard.lob.com/#/templates/' + template.id" target="_blank">Preview</a></p> | |
</li> | |
</ul> | |
</template> | |
<style scoped> | |
li { | |
display: block; | |
} | |
.template-frame { | |
width: 200px; | |
height:300px; | |
overflow: hidden; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment