knowyt/client/src/components/GameControls.vue
2021-08-13 00:41:23 +02:00

32 lines
557 B
Vue

<template>
<nav v-if="isGamemaster" class="gamecontrols">
<button @click="startGame">Start</button>
</nav>
</template>
<script>
export default {
computed: {
user() {
return this.$store.state.engine.user || {}
},
isGamemaster() {
const user = this.$store.state.engine.user
return user && user.role === 'gamemaster'
},
},
methods: {
startGame() {
this.$engine.startGame()
},
},
}
</script>
<style lang="scss">
.gamecontrols {
padding: 8px 1em;
border-bottom: 1px solid #808080;
}
</style>