add items
This commit is contained in:
parent
03719832a3
commit
54bc523465
@ -1,10 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import { RouterLink, RouterView } from 'vue-router'
|
||||
import HelloWorld from './components/HelloWorld.vue'
|
||||
import { RouterView } from 'vue-router'
|
||||
// import { RouterLink, RouterView } from 'vue-router'
|
||||
// import HelloWorld from './components/HelloWorld.vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<header>
|
||||
<!-- <header>
|
||||
<img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125" />
|
||||
|
||||
<div class="wrapper">
|
||||
@ -15,7 +16,7 @@ import HelloWorld from './components/HelloWorld.vue'
|
||||
<RouterLink to="/about">About</RouterLink>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
</header> -->
|
||||
|
||||
<RouterView />
|
||||
</template>
|
||||
|
42
src/components/GameWindow.vue
Normal file
42
src/components/GameWindow.vue
Normal file
@ -0,0 +1,42 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
|
||||
const place = ref("")
|
||||
const team = ref({})
|
||||
|
||||
function getTeam() {
|
||||
fetch("http://localhost:8090/team", {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"X-Id": "1",
|
||||
"X-Password": "pass"
|
||||
},
|
||||
})
|
||||
.then((response) => {
|
||||
team.value = response.json()
|
||||
})
|
||||
.then((json) => console.log(json));
|
||||
}
|
||||
|
||||
function addAction() {
|
||||
console.log(place.value)
|
||||
// сходить в сеть
|
||||
}
|
||||
|
||||
getTeam()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="!team.actions.length">
|
||||
Пора решать загадку
|
||||
</div>
|
||||
<div v-else v-for="action in team.actions">
|
||||
<p>{{ action.text }}</p>
|
||||
</div>
|
||||
|
||||
<input v-model="place" placeholder="Место назначения (Пример А-1, регистр не важен, тире можно опустить)" />
|
||||
<button v-on:click="addAction">Поехали</button>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
@ -1,9 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import TheWelcome from '../components/TheWelcome.vue'
|
||||
import GameWindow from '@/components/GameWindow.vue';
|
||||
|
||||
// import TheWelcome from '../components/TheWelcome.vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<main>
|
||||
<TheWelcome />
|
||||
<!-- <TheWelcome /> -->
|
||||
<GameWindow />
|
||||
</main>
|
||||
</template>
|
||||
|
Loading…
x
Reference in New Issue
Block a user