vue-select
vue-select copied to clipboard
Nested submenus in dropdown options
Currently Options value : [ { id : 1, name : 'test'}, { id : 2, name : 'test 1'}, ]
Behaviour :
Expecting behaviour :
[ { id : 1, name : 'A',children : [{ id : 1, name : 'AA'},{ id : 2, name : 'AB'}]}, { id : 2, name : 'B', children : [{ id : 1, name : 'test'},{ id : 2, name : 'test 1'}]}, ]
I guess this is already doable using the option
slot by passing a custom template.
I guess this is already doable using the
option
slot by passing a custom template.
@Papooch please share some example code.
Actually, I was thinking about it. What is the desired behavior here? Can you select a root node as the choice? Or are those only a separator? Should you be able to expand/collapse the nodes by clicking (that one would not be possible I guess)? Should all the root nodes still show up if none of their child nodes match?
Actually, I was thinking about it. What is the desired behavior here? Can you select a root node as the choice? Or are those only a separator? Should you be able to expand/collapse the nodes by clicking (that one would not be possible I guess)? Should all the root nodes still show up if none of their child nodes match?
Can you select a root node as the choice? - Yes Should you be able to expand/collapse the nodes by clicking - Yes
I tried to put together a quick demo with the first feature: https://jsfiddle.net/5ea7zc8n/16/
It may be possible to add the collapsing with some events that modify the nodes array (like set collapsed = true) and make the search better by passing a callback function as options
, but I hope you get the idea.
I tried to put together a quick demo with the first feature: https://jsfiddle.net/5ea7zc8n/16/ It may be possible to add the collapsing with some events that modify the nodes array (like set collapsed = true) and make the search better by passing a callback function as
options
, but I hope you get the idea.
Thank you very much @Papooch 👍 . i got some idea.