setTimeout(
handler: async () => {
const response = await axios.get(
"https://jsonplaceholder.typicode.com/posts/?_limit=10"
);
console.log(response);
this.posts = response.data;
},
timeout: 1000)
} catch (e) {
alert("ошибка");
}
},
},
async fethcPosts() { try { setTimeout( async () => { const response = await axios.get( "https://jsonplaceholder.typicode.com/posts/?_limit=10" ); console.log(response); this.posts = response.data; },1000) } catch (e) { alert("ошибка"); } }, },
благодарю отработало
Обсуждают сегодня