No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    q-drawer-linux question

    Help
    6
    16
    3854
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Sfinx last edited by

      Typo made: the click.native works but along with router.push(). It is possible to disable default routing event in particular q-drawer-link element ?

      1 Reply Last reply Reply Quote 0
      • rstoenescu
        rstoenescu Admin last edited by

        What are you trying to achieve? Why do you need route change and also a “click” event handler?

        1 Reply Last reply Reply Quote 0
        • S
          Sfinx last edited by

          I think that routes is overcompilcated concept and better suited to the web only apps that needs constant links. So take in account current routes problems with Cordova. For the SA the simple clicks is fully sufficient where you can just open/close needed dialogs or show/hide layouts. In short I’m tryng to create the SA without routes. This requires to react to clicks only which appears as the problem at least for the q-drawer-link which pushes the route in any way. I’ve made workaround with custom component but trying to figure out if this approach is possible using stock ones.

          1 Reply Last reply Reply Quote 0
          • rstoenescu
            rstoenescu Admin last edited by rstoenescu

            Ah, but in your situation, why don’t you use a simple list without the q-drawer-link? DrawerLink (as its name implies) is supposed to get you to another route. Its HTML template is just syntactic sugar over a list item with the additional handling of route change.

            1 Reply Last reply Reply Quote 0
            • W
              wdiechmann last edited by

              (total noob, sorry!) but if I would like a (left) drawer with 2-3 links AND a “link” to a modal for login?

              1 Reply Last reply Reply Quote 0
              • rstoenescu
                rstoenescu Admin last edited by

                @wdiechmann same principle applies. If you don’t want routes, then just create the list items which do whatever you want on click events. Only thing is you need to take care is to delay opening a Modal with 100ms (so a click event with a setTimeout in it).

                1 Reply Last reply Reply Quote 0
                • A
                  aswinkp last edited by

                  we cant even use “v-go-back” in <q-drawer-link> because :to is a required prop. It would be better if we have these props optional.

                  A 1 Reply Last reply Reply Quote 0
                  • A
                    aswinkp @aswinkp last edited by

                    @aswinkp said in q-drawer-linux question:

                    we cant even use “v-go-back” in <q-drawer-link> because :to is a required prop. It would be better if we have these props optional.

                    I think it is a must have because, logout will be mostly in the drawer. This forces to use list instead.

                    LaurentPayot 1 Reply Last reply Reply Quote 0
                    • LaurentPayot
                      LaurentPayot @aswinkp last edited by LaurentPayot

                      @aswinkp you can “cheat” this way :
                      (in pug/jade)

                      div(@click.capture="signout")
                      	q-drawer-link(icon="person_outline", :to="{exact: true}")
                      		| {{$t('auth.signout.label')}}
                      
                      1 Reply Last reply Reply Quote 0
                      • rstoenescu
                        rstoenescu Admin last edited by

                        It makes no sense to use a drawer-link if you don’t link it to a route. What I keep saying is that you can simply create a list item and assign @click event to it. No need for DrawerLink in this case.

                        1 Reply Last reply Reply Quote 0
                        • LaurentPayot
                          LaurentPayot last edited by LaurentPayot

                          Sure, but using a route-less drawer-link is the simplest way to get all the CSS classes to make it perfectly aligned with the others “normal” drawer-links of the drawer.

                          1 Reply Last reply Reply Quote 0
                          • A
                            afd last edited by

                            @LaurentPayot : you could write a small component that inserts the proper markup.

                            LaurentPayot 1 Reply Last reply Reply Quote 0
                            • LaurentPayot
                              LaurentPayot @afd last edited by LaurentPayot

                              @afd I’m so lazy, once you’re into pug there’s no coming back to html 😉 Here is the html, if that’s what you’re asking for…

                              <div @click.capture="signout">
                                <q-drawer-link icon="person_outline" :to="{exact: true}">
                                  Sign out
                                </q-drawer-link>
                              </div>
                              
                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post