Created
November 16, 2017 01:25
-
-
Save duwaljyoti/24c40bce51b55a165cfa8e54300e37f6 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="note-form"> | |
| <div class="component-header">Create A new Note</div> | |
| <form @submit.prevent="add"> | |
| <input v-model="title"> | |
| <button type="submit">Create</button> | |
| </form> | |
| </div> | |
| </template> | |
| <script> | |
| export default { | |
| name: 'CreateNote', | |
| data() { | |
| return { | |
| title: '' | |
| } | |
| }, | |
| methods: { | |
| add() { | |
| this.$store.dispatch('add', this.title); | |
| this.$router.push('/list'); | |
| flash('Note Created.', 'success'); | |
| } | |
| } | |
| } | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment