My application is designed to allow a user to select a Person, and then Vue makes an API call for that user's posts. Each post has its own set of comments sourced from here.
You can view the codepen here
Here is my HTML structure:
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<div id='app'>
<div v-if='isError'>
There was an error
</div>
<div v-else-if='isLoading'>
Loading...
</div>
...
</div>
JavaScript logic implementation:
var app = new Vue({
el: '#app',
data: {
info : null,
isLoading : true,
isError : false,
selectedUser : '',
postData : null,
isLoadingPosts : true,
commentData : null,
},
...
}
})
Despite everything functioning correctly, I am facing challenges with the comments section as it always seems to be empty. Additionally, I believe there might be some repetitive code in my implementation. Any suggestions or corrections would be highly appreciated. Thank you!