Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand on root level expands all childs #125

Closed
NTTAKR opened this issue Aug 4, 2021 · 1 comment · Fixed by #131
Closed

Expand on root level expands all childs #125

NTTAKR opened this issue Aug 4, 2021 · 1 comment · Fixed by #131
Labels

Comments

@NTTAKR
Copy link

NTTAKR commented Aug 4, 2021

I want to give the user a good option to get the overall structure of a JSON data item.

I display only the level one nodes on the root. The rest is shown with showLength="true".
As soon as the user clicks on any bracket ALL child nodes below that are recursively expanded.
How can I change that behavior to only expand the next level on the node I clicked on?

@fredrivett
Copy link
Contributor

fredrivett commented Aug 17, 2021

I agree with this PR, have had a look at the codebase and submitted a couple PR's, one for the 1.x branch (Vue 2: #130) and one for the dev branch (Vue 3: #131).

This is working locally for me, the simple change is to this line:

Vue 2:

item.level === this.deep

Vue 3:
item.level === props.deep

For both of these the diff to implement this (without the prop option used in the PR's):

-         item.level === this.deep
+         item.level >= this.deep

Hopefully the maintainers will agree and merge in my PR's but the above change will work if you want this functionality before that. I implemented it by copying the src to my project, updating the relative links and changing that line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants