Skip to content

Instantly share code, notes, and snippets.

@duwaljyoti
Created November 16, 2017 01:25
Show Gist options
  • Select an option

  • Save duwaljyoti/24c40bce51b55a165cfa8e54300e37f6 to your computer and use it in GitHub Desktop.

Select an option

Save duwaljyoti/24c40bce51b55a165cfa8e54300e37f6 to your computer and use it in GitHub Desktop.
<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