-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Items listed after an item with children aren't displayed #26
Comments
Isn't this like the desired behaviour? 😅 I may also not get the point… so yeah 😄 The double |
I don't think so, but it may not be clear here. I suck at explaining stuff 😅 The issue is the first path is So basically, you can only have 1 top-level item with children. If you wanted multiple top-level items with children, they wouldn't render. Hopefully that makes more sense? |
Ahhhh, i see 😬 [
{
id: "Home",
title: "Home",
children: ["Notifications"],
},
{
id: "Notifications",
title: "Notifications",
parent: "Home",
},
{
id: "Publish",
title: "Publish",
},
{
id: "Settings",
title: "Settings",
},
{
id: "Theme",
title: "Theme",
},
]; If you inspect the property [
{
"id": "Home",
"title": "Home",
"children": ["Notifications"]
},
{
"id": "Publish",
"title": "Publish",
"parent": "Home",
"children": []
},
{
"id": "Settings",
"title": "Settings",
"parent": "Home",
"children": []
},
{
"id": "Theme",
"title": "Theme",
"parent": "Home",
"children": []
},
{
"id": "Notifications",
"title": "Notifications",
"parent": "Home",
"children": []
}
] My best guess would be something going sideways in flatten function… feels like the initial level isn't set right |
Ah. I see. Sweet. Well, if it helps any, here's a bit more of how I'm actually using it. let pages = [];
if (this.user.isSpecial) {
pages.push({ id: "Publish", title: "Publish" })
} So in this case, I'm not using a flat structure since each user could have a different set of pages based on their access level. I think I might be able to try the flat structure though. Thanks for the update! |
Hi @oddcelot |
@oddcelot Thanks a lot for finding and solving the issue! For people finding this issue in the future: @ssleptsov I hope everything's alright! Please ping or DM me if/when you merge the PR and release a hotfix so I can mark my fork as deprecated and advise people to return back to your original package. |
I'm using this with Vue2, so not sure if it's related to that.... It seems which ever items has
children: []
, any item below that never gets rendered, but is still searchable.This may just be a configuration setup issue, but I'm not sure what I'm missing.
Using version
1.2.1
The text was updated successfully, but these errors were encountered: