The code below shows how to remove the selected row from the TreeGrid.
<TreeGrid
style="height:250px"
:data="data"
idField="id"
treeField="name"
:selection="selection"
@selectionChange="selection=$event"
>
...
if (this.selection.parent) {
const index = this.selection.parent.children.findIndex(
row => row == this.selection
);
if (index >= 0) {
this.selection.parent.children.splice(index, 1);
}
} else {
const index = this.data.findIndex(row => row == this.selection);
if (index >= 0) {
this.data.splice(index, 1);
}
}
this.data = this.data;