Created
June 5, 2021 10:11
-
-
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
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
<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