Every item in my list has a remove button. When I press it, I want item to be removed.
Additionally, I have a need to add items to my current rendered Sortable component.
It seems that Sortable component doesn't react to removals or additions. In order for Sortable to update itself with new "list" value, I need to pass unique Vue "key" property to Sortable component. Only then Sortable component re-renders itself... But it has many drawbacks as every item looses its rendering state...
Good afternoon,
Every item in my list has a remove button. When I press it, I want item to be removed. Additionally, I have a need to add items to my current rendered Sortable component.
It seems that Sortable component doesn't react to removals or additions. In order for Sortable to update itself with new "list" value, I need to pass unique Vue "key" property to Sortable component. Only then Sortable component re-renders itself... But it has many drawbacks as every item looses its rendering state...
Could you give me an example (based on https://github.com/MaxLeiter/sortablejs-vue3/blob/main/src/examples/WithStore.vue) how to add an item to the fruits list and how to remove a fruit from the list so that other items are not mounted again?