VueJS Components array ( for sorting )

Feb 7, 2018 · 1 min read

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.

 by the author.


Written by


Software Engineer…

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade