vue-grid-layout
vue-grid-layout copied to clipboard
when I delete one item, the grid-item would not be rearranged
I have a dashboard use your plugin, each time I delete one item, the grid-item would not be rearranged, and the method layout-updated would not be triggered? What should I do? (Thanks for help)
Have you set the vertical-compact prop? I think it will help.
@chenenpei thank you for your advice,now grid-item would be rearranged. the problem is that when I delete item , layout-updated event would not be triggered, however , I need save item position to database, look forward solutions, thanks
There isn't a default deletion event provided for grid-item, so I assume you implemented one by yourself. My suggestion is printing out the grid-layout component after deletion, then you may find what you need there. The codes below may give you a hint.
<grid-item @click.native="onRemove(item)"/>
watch: {
layout() {
console.log(this.$refs('layout');
},
},
methods: {
onRemove(val) {
this.layout = this.layout.filter(item => item.i !== val.i);
}
}
The data has changed, but the item arrangement has not been updated
Any news on this? I'm having the same issue.