Created
June 28, 2021 16:58
-
-
Save mattmaribojoc/ae54d9cd482ec81ca0f0b7e22ccc0694 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<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