Imagine you have a list of posts retrieved from an ajax response, and now you want to provide users with the option to edit any specific post by clicking a button. One approach could be using the v-show directive to attach a form component to each post. When the user clicks the edit button, the post div would be hidden while the form displaying the post's body and title would appear. After saving, the form would hide again, a request would be sent to update the post on the server, and then the updated post would reappear.
But is it possible to achieve this functionality without attaching and hiding elements in the first place? How often will users actually need to edit their posts? It would be more efficient if a function or another method could be called upon button click that generates a component with text fields filled with the post data for editing.
The big question - can this be done in Vue?