QDrawer persistence property



  • Simply trying to get a drawer to automatically close upon detection of a new route, which is what the persistence property is all about ( https://quasar.dev/layout/drawer when set to default true: does not auto-closes when app’s route changes).

    Problem is that in the Vue dev tool, it’s showing the value as a string (instead of a boolean), even though I have the attribute value unquoted (also tried with quotes just to check)

    Snippet:
    <q-drawer v-model=“left” side=“left” persistent=false>

    Am I missing something here? Much appreciation for any guidance.



  • @keenwa not passing a value to it will set it to true, now if you want to control set it true/false then just bind a boolean data to it :persistent="isPersist".



  • @metalsadman thanks so much for the quick reply, you are clearly a rock star.

    Your fix did in fact work to get the property correctly showing in the Vue dev tool (as false), but the drawer is still remaining open upon changing of the route. I figured it would auto-collapse after changing routes, but it just stays open.

    new snippet:
    <q-drawer v-model=“left” side=“left” :persistent=“isPersist”> // isPersist is being set to false in the export data(), and verified working in Vue dev tool

    Thanks again!


Log in to reply