Skip to content

Instantly share code, notes, and snippets.

@afucher
Created January 13, 2017 00:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afucher/b242bdafb0dd804ee3cb4fdd3241e02f to your computer and use it in GitHub Desktop.
Save afucher/b242bdafb0dd804ee3cb4fdd3241e02f to your computer and use it in GitHub Desktop.
<template>
<div>
<form @submit.prevent="createGroup">
<input type="text" v-model="start_date"></input>
<button type="submit">Nova Turma</button>
</form>
</div>
</template>
<script>
import { mapActions } from 'vuex'
export default {
data: function(){
return {
start_date: '',
end_date: '',
start_hour: '',
end_hour: ''
}
},
methods: {
createGroup(e) {
e.preventDefault();
let course = {
start_date: this.start_date,
end_date: this.end_date,
start_hour: this.start_hour,
end_hour: this.end_hour
}
this.$store.dispatch('createGroup', course);
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment