Created
September 6, 2017 18:29
-
-
Save Attila03/bfd0231a01ff1cba228e5d1d4b809c76 to your computer and use it in GitHub Desktop.
This file contains 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 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