How to do a link and close the popover



  • Hi, guys!

    How can I close my popover when I do a click? Or are there another code that I can use to do a dropdown menu on qbtn component?

    <q-item @click="$router.push('/preferences'), $refs.popover.close()">
        <q-item-main label="Preferences" />
    </q-item>
    
    <q-item item to="/company" @click="$refs.popover.close()">
        <q-item-main label="Company" />
    </q-item>
    

    Regards,

    Lucas Simon



  • @lucassrod I came across a similar problem. Here’s my code

    <q-btn>MENU
            <q-popover ref="popover">
                <q-list>
                    <q-item @click="$router.push('/settings'); $refs.popover.close()">
                        <q-item-side icon="settings" />
                        <q-item-main label="Settings" sublabel="" />
                    </q-item>
                    <q-item @click="$router.push('/orders'); $refs.popover.close()">
                        <q-item-side icon="receipt" />
                        <q-item-main label="Orders" sublabel="" />
                    </q-item>
                </q-list>
            </q-popover>
        </q-btn>
    

  • Admin

    $refs.popover.close(() => $router.push('/settings'))


Log in to reply
 

Looks like your connection to Quasar Framework was lost, please wait while we try to reconnect.