Guest User

Untitled

a guest
Nov 17th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <template>
  2. <div class="note-form">
  3. <div class="component-header">Create A new Note</div>
  4. <form @submit.prevent="add">
  5. <input v-model="title">
  6. <button type="submit">Create</button>
  7. </form>
  8. </div>
  9. </template>
  10.  
  11. <script>
  12. export default {
  13. name: 'CreateNote',
  14. data() {
  15. return {
  16. title: ''
  17. }
  18. },
  19. methods: {
  20. add() {
  21. this.$store.dispatch('add', this.title);
  22. this.$router.push('/list');
  23. flash('Note Created.', 'success');
  24. }
  25. }
  26. }
  27. </script>
Add Comment
Please, Sign In to add comment