Element ui el tree How to refresh an instance of tree after adding and deleting nodes

  • 2021-08-09 07:05:43
  • OfStack

1. Refresh the current node after adding a new node

node.loaded = false;

node.expand();

//To create a new child node is to refresh the expansion request of this node once, while to rename and delete, it is necessary to refresh the expansion event of the parent node.

2. Delete Node

node.parent.loaded = false

node.parent.expand()

Over ~

Additional knowledge: element-ui component el-tree Add button works, delete button, data will change, but the page will not be updated

Maybe the version of element-ui is too low

I use element-ui 2.4. 6

It turned out that 2.4. 11 worked

All updated element-ui versions

cnpm i element-ui@2.13.1


Related articles: