How to realize the semi-selected state of the parent node when all the element-ui tree child nodes are not selected?

problem description

tree in element-ui, which by default looks like this:

  • No child nodes are selected, and no parent nodes are selected
  • all child nodes are selected, and parent nodes are selected
  • Child node is partially selected, parent node is semi-selected
Is it possible for

to become like this:

  • none of the child nodes are selected, and the parent node is semi-selected
  • all child nodes are selected, and parent nodes are selected
  • Child node is partially selected, parent node is semi-selected

the main difference is that when none of the child nodes are selected, the parent node is half-selected.

May.10,2022
Menu