I am a beginner with vue.js and I have encountered a challenge. On my page, I display a list of people with an 'Edit' button next to each person's details. My goal is to switch to another page when the Edit button is clicked, where I can edit the selected person's information.
Currently, I am using Bootstrap and Router in my solution but I'm unsure about the best approach to achieve this. I am considering two options:
Option 1: One idea is to route to '/person/:id' upon clicking the Edit button, but I am struggling with implementing this functionality within the click handler method.
Option 2: In the main component below, named Home.vue, I am attempting to toggle between two components - 'PersonsList' and 'EditPersonData' based on events emitted by PersonsList component. Although PersonsList successfully emits the event, I am uncertain about how to listen for it and switch to the EditPesonData component.
Any assistance you could offer would be greatly appreciated.
Thank you