This is my code where I am attempting to make an API call in Ionic 5 using Axios
import axios from "axios";
import {
IonCard,
IonCardContent,
IonCardSubtitle,
IonCardTitle
} from "@ionic/vue";
export default {
name: "Tab1",
components: {
IonCard,
IonCardContent,
IonCardSubtitle,
IonCardTitle
},
data() {
return { posts: [] };
},
created() {
axios.get("http://gautammenaria.com/wp-json/wp/v2/posts").then(response => {
this.posts = response.data;
});
}
};
Encountering the following error (Although data is being retrieved as expected )
TS2339: Property 'posts' does not exist on type '{ name: string; components: {
Uncertain about the issue