q-tree clicking on label to expand doesn't work if select is being used #8902
-
Hi hoping someone can help. So the functionality I'm trying to achieve is if a node has children it expands by clicking on the node label and if not it selects. Using the arrow to expand does work but this isn't as nice an experience for users. Currently with the q-tree it looks like a node can't be expandable if it's not selectable. I can fix it with a handler function but this isn't so good in JSON (for me anyway since I'm passing the tree in question from the backend and JSON strips out functions). Any answers for this? Here's the template code.
And the data section has
If i replace the template code and remove the select like so:
I get the expand functionality I want but lose the select functionality. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
don't use/set |
Beta Was this translation helpful? Give feedback.
don't use/set
selectable
props, and handle your condition in@update:selected
, leveraging QTree's exposed methods.https://codepen.io/metalsadman/pen/LYxrZGb?editors=1010