holiber / sl-vue-tree

Customizable draggable tree component for Vue.js
MIT License
344 stars 79 forks source link

Fixed TypeScript definition for updateNode #72

Open Alexlg89 opened 4 years ago

Alexlg89 commented 4 years ago

I couldn't get the updateNode function to work in my project. We are using TypeScript. The TypeScript definition for the updateNode Function was incorrect. The first parameter in the definition is a ISlTreeNode, but the code uses the path (number[]).

I changed the parameter from

nodeToUpdate: ISlTreeNode<TDataType>

to

path: number[]

Best regards, Alex

Edit: Alongside using this package, i noticed that the definition for the methods insert and remove also where missing in the TypeScript definition. I added them, too ;)