generated from VLADIMIR/template_frontend
add items
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user