Skip to content

Instantly share code, notes, and snippets.

@Attila03
Created September 6, 2017 18:29
Show Gist options
  • Save Attila03/bfd0231a01ff1cba228e5d1d4b809c76 to your computer and use it in GitHub Desktop.
Save Attila03/bfd0231a01ff1cba228e5d1d4b809c76 to your computer and use it in GitHub Desktop.
<template>
<div id="register-tournament">
<input type="text" v-model="tournamentName"/>
<button type="button" v-on:click="createTournament">Create Tournament</button>
<div id="tournament-created" v-if="createdTournamentName">
<p>{{ createdTournamentName }} has been created</p>
<router-link to='/register-players'><button type="button">Proceed to add players >> </button></router-link>
</div>
</div>
</template>
<script>
import axios from 'axios';
export default {
name: 'registerTournament',
data: function(){
return {
tournamentName: ''
}
},
computed: {
createdTournamentName: function(){
return this.$store.state.currentTournament.name;
}
},
methods: {
createTournament: function(){
this.$store.dispatch('createTournament', this.tournamentName)
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment