Genie Discord forum

Author Avatarwerner castro
10/2/2023, 7:51:49 PM

I'm trying to use the drawer component through the parse_vue_html method, but I'm having some errors. Can someone show me an example of this component, I haven't seen documentation for it.

Author AvatarPere
10/5/2023, 9:29:48 AM

Please provide some code and the error you're getting. Otherwise it's hard to help.

Here's an example. You need to define the drawer sections as a list, and then in the main page set a conditional rendering with @iif so that the section is only shown when the corresponding menu button is selected

        drawer(bordered = "", fieldname = "left_drawer_open", side = "left",
            list(bordered = "", [
                item(clickable = "", vripple = "", @click("selected_component = 'form'"),
                    itemsection(
                        "Form components"
                    )
                ),
                    item(clickable = "", vripple = "", @click( "selected_component = 'badge'"),
                    itemsection(
                        "Badge"
                    )
            ),
            ])
        ),
        page_container(
        [
                Html.div(@iif("selected_component == 'form'"), [ui(Slider), ui(FilePicker), ui(TextInput)]) ]
        ),
Author AvatarPere
10/5/2023, 9:30:45 AM

and define these variables in @app @in left_drawer_open = false @in selected_component = ""

Author Avatarwerner castro
10/5/2023, 12:10:49 PM

Thanks, you're right. I thought I put the error