<template>
<ul>
<li v-for="item in list">
<h3>{{item.title}}</h3>
<p>{{item.text}}</p>
</li>
</ul>
</template>
<script>
export default {
data(){
return {
list: ''
}
},
computed(){
// Запросим данные с сервера и сохраним наш json в data
fetch('/api/users') // По этому адресу мы получим у сервера данные о пользователях
.then((response) => {
this.list = response // запишем эти данные в data
})
.catch(error => console.error(error))
}
}
</script>
fetch('/contacts') // Запрашиваем у сервера данные по странице контакты
.then((response) => {
// Тут будет то, что вернул вам сервер
console.log(response));
// Далее вы раскидываете данные
...
})
.catch(error => console.error(error)); // Если вдруг была ошибка
client.pop('games:wait')
client.hgetall('games:wait:' + token)
client.hgetall('account:' + player1)
client.pop('games:wait')
.then((token) => client.hgetall('games:wait:' + token))
.then(({gameInfo: player1}) => client.hgetall('account:' + player1)
.then((accountInfo) => console.log(accountInfo))
.catch((error) => console.error(error));
.ico1 {animation-delay: 0;}
.ico2 {animation-delay: .5s;}
.ico3 {animation-delay: 1s;}
.ico4 {animation-delay: 1.5s;}
.ico5 {animation-delay: 2s;}