Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Children in children not working #274

Open
steptro opened this issue Dec 11, 2019 · 2 comments
Open

Children in children not working #274

steptro opened this issue Dec 11, 2019 · 2 comments

Comments

@steptro
Copy link

steptro commented Dec 11, 2019

Children inside children does not seem to be working. I'm using the following sidebar configuration

[
    {
        "title": "name",
        "children": [
            {
                "title": "item 1",
                "link": "#"
            },
            {
                "title": "item 2",
                "link": "#"
            },
            {
                "title": "another list",
                "children": [
                    {
                        "title": "item 3",
                        "link": "#"
                    }
                ]
            }
        ]
    }
]

When using this sidebar configuration, I get the following error:
Screenshot 2019-12-11 at 14 13 46

When I remove the item with the children it works as expected.

@steptro steptro changed the title Children in children Children in children not working Dec 11, 2019
@zakrzk
Copy link

zakrzk commented Jan 2, 2020

Same here, is there any other way to implement multi-level menu?

@steptro
Copy link
Author

steptro commented Jan 10, 2020

The problem is that SideBarItem cannot have any children. See https://github.com/egoist/docute/blob/master/src/components/SidebarItem.vue#L37-L52.

This could probably be fixed by adding a SideBarItem if it detects that the item has children:

<div
      class="ItemChildren"
      v-if="children && (open || item.collapsable === false)"
    >

      <div class="ItemChild" v-for="(link, index) of children" :key="index">
        ...

        <sidebar-item
          v-if="link.children"
          :item="link"
          :open="closedItems.indexOf(index) === -1"
          @toggle="toggleItem(index)"
        />
      </div>
    </div>

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

No branches or pull requests

2 participants