Skip to content

Instantly share code, notes, and snippets.

@isaacssemugenyi
Created June 5, 2021 10:11
Show Gist options
  • Save isaacssemugenyi/80400f1dd38eb64d5c6fbcc095ac388b to your computer and use it in GitHub Desktop.
Save isaacssemugenyi/80400f1dd38eb64d5c6fbcc095ac388b to your computer and use it in GitHub Desktop.
script section with a data property defining the data we expect to get from the form and a submitData method that alerts the form data when a form is submitted
<script>
export default {
name: "ArticleForm",
data() {
return {
article: {
title: "",
description: ""
}
};
},
methods: {
submitData(){
const submittedData = `${this.article.title} ${this.article.description}`
alert(submittedData)
}
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment