Track prop changes and save old and new prop values for creating a timeline

Hi all,

I need to create a status timeline in my Vue.js application. For now, I’m receiving a String with the current status of a shop article. Articles can be Activated, Deactivated, Cancelled or Partially activated, not necessarily in the previous order.

I would like to create a timeline with the current status of the articles and then, when the prop with the status changes, receive the old value, store it and show both of them. If the article goes through more than two status, store the two old ones too. So the user could be able to see the timeline of the status that the article went through.

Can someone help me to find a way?

Use an array, make the value array[array.length-1], and to change the status, just push the new status into the array, that way the value is always the latest status but you also have a history of status’

It’s not about tracking the changes it’s about changing the status in a way where you also store that change event somewhere else too, should be fairly simple, there’s numerous ways to do it