generated from VLADIMIR/template_frontend
add result
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { NButton } from 'naive-ui'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import { ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
@@ -27,6 +28,10 @@ getGames()
|
||||
async function toGame(id: number) {
|
||||
router.push('/games/' + id)
|
||||
}
|
||||
|
||||
function toResults(id: number) {
|
||||
router.push('/games/' + id + '/results')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -39,6 +44,9 @@ async function toGame(id: number) {
|
||||
<div class="game-description">
|
||||
{{ game.description }}
|
||||
</div>
|
||||
<div v-if="game.status == 'finish'" class="game-actions">
|
||||
<n-button size="small" ghost @click.stop="toResults(game.id!)">Результаты</n-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -64,6 +72,12 @@ async function toGame(id: number) {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.game-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.game-description {
|
||||
color: #aaa;
|
||||
margin-bottom: 10px;
|
||||
|
||||
Reference in New Issue
Block a user