riophae / vue-treeselect

A multi-select component with nested options support for Vue.js
https://vue-treeselect.js.org/
MIT License
2.91k stars 509 forks source link

Disable selection of root branches while having multiple=false #494

Open s3dse opened 2 years ago

s3dse commented 2 years ago

Hello,

I have a tree that should allow only a single selection. The root branches should not be selectable, while their children branches and leafs should be selectable. Settings disable-branch-nodes is not an option. I set isDisabled=true on the root nodes and set :flat="true" on the component. However, I need the tree to only allow a single selection. I get a warning if I set :multiple="false" on the component, just as the documentation describes.

Is there a better way to do this, without receiving a warning?