Relative Content

Tag Archive for javascriptvuejs2watch

How to solve duplicating update in Vuejs 2 component

I have a child component “DetailsDialog” in which I watch for a prop change and then request an API call. The problem is that the API call is executing twice instead of once, so, I believe is because the component is updating double. I am using VueJS 2.7, OptionsAPI and basically I just want that when I click a row in a datatable the app call an API to show data dynamically. I even called updated() hook and inside a console.log and indeed, is updating twice. So, I need to call the API just once in the component when its prop is updated. I’d appreciate the help, thanks in advance