How does the element tree control switch the selected state?

the effect I want to achieve is that when I click the cross on the right, the data on the right will be cleared, and the data corresponding to the tree control on the left will also be unchecked. Can it be realized and how?

Feb.24,2022

when you click on the right cross, you can get the corresponding data and change the state on the left


you can use the getCheckedKeys method of the tree control


is there a complete code? Recently, I have also encountered such a demand,

Menu