Skip to content

Instantly share code, notes, and snippets.

@mattmaribojoc
Created June 28, 2021 16:58
Show Gist options
  • Save mattmaribojoc/ae54d9cd482ec81ca0f0b7e22ccc0694 to your computer and use it in GitHub Desktop.
Save mattmaribojoc/ae54d9cd482ec81ca0f0b7e22ccc0694 to your computer and use it in GitHub Desktop.
<template>
<div class="popup">
<div class="content">
<p> Loaded API: {{ article }} </p>
<h4> Login to your account </h4>
<input type="text" placeholder="Email" />
<input type="password" placeholder="Password" />
<button> Log in </button>
</div>
</div>
</template>
<script>
const getArticleInfo = async () => {
// wait 3 seconds to mimic API call
await new Promise(resolve => setTimeout(resolve, 1000));
const article = {
title: 'My Vue 3 Article',
author: 'Matt Maribojoc'
}
return article
}
export default {
async setup() {
const article = await getArticleInfo()
console.log(article)
return {
article
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment