QTree v-model:selected to return the entire node #16173
Unanswered
Tofandel
asked this question in
Ideas / Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently the selected v-model of the QTree uses the id of the node to determine if its selected and returns that id
It's not always very useful and having the entire node might make more sense in some cases but with just the id we have to iterate recursively on the nodes to find the selected
I'd like to add a prop to change this behaviour
I will make a PR, I just would like to know the preferred implementation
@update:selectedacts as the second functionThe 2nd option is more flexible but more verbose, the 1st I think already covers most of the cases possible with the second option
The 3rd option is the simplest, it only changes one line, but may not cover all use cases
I like the second option because it also allows you to just pass a comparison function to just check properties on the node like
(node) => node.isSelectedindifferently of the selected prop as wellBeta Was this translation helpful? Give feedback.
All reactions