N00ts / vue3-treeview

a simple treeview in vue js 3
MIT License
71 stars 61 forks source link

On initial load checkboxes are not respecting intermediate or checked values of parent #49

Open pranav9956 opened 5 months ago

pranav9956 commented 5 months ago

Suppose i have a array of nodes out of which some are checked and some are not. On loading correct nodes are marked checked, but their parent nodes are meither checked nor they have intermediate state.

If i manually click on checkbox then it is fine but if :nodes data itself has some chcked state on some nodes it does not automatically maintain state of its parent.

For Example nodes look like this ->A -> B -> C

And by default B is has {state: {checked: true}}. Then on rendering A is not having intermediate state.

N00ts commented 5 months ago

Hey, can you provide a codesandbox ?

pranav9956 commented 5 months ago

Hi @N00ts here is the demo sandbox .

You can see here only node - id11 is checked. Although checkMode is 0

Screenshot 2024-03-27 at 9 07 39 PM

You will see

pranav9956 commented 4 months ago

Hi @N00ts :) did u got chance to look into it?