VueJS Components array ( for sorting )

Recently I have to use vue-draggable for existing components which are acting as dashboard widgets. Drag and Drop feature worked well. But after User sort the order of the widgets, I had to save the sorting order to the DB in order to retrieve the widget order when the user logged in to the system next time.

So my initial code was like this.

I have tried to use the few ways but one of my colleague (Uthpala) passed me this link.

Also with some exploration I got this resource also

Finally I managed to fix my problem using below code snippet.

I hope some vueJS dev can get help from this.

Written by

Software Engineer…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store