Created
June 5, 2020 19:56
-
-
Save james0r/e2ee2015ab14245c9531cfca11599852 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
<script> | |
export default { | |
data() { | |
return { | |
greeting: null, | |
name: null | |
} | |
}, | |
metaInfo: { | |
title: 'Hello, world!' | |
}, | |
mounted() { | |
if (this.$route.query.name) { | |
this.name = this.$route.query.name | |
} | |
fetch('/.netlify/functions/hello-world?name=' + this.name) | |
.then( | |
res => res.json() | |
) | |
.then( | |
res => { | |
this.greeting = res.message | |
} | |
) | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment