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

    [SOLVED] [v1] q-expansion-item: is it possible to have BOTH a route AND menu-click expansion?

    Framework
    2
    6
    454
    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.
    • ssuess
      ssuess last edited by ssuess

      I would like to have my expansion item expand when clicking anywhere in it, AND go to the route defined, but it seems if I have a route defined, ONLY the icon click will trigger the expansion. Is there anyway to make both things happen on clicking anywhere on the item (as it does when there is no route defined)?

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

        ok I found a solution for this (although a toggle would be nice so I don’t have to resort to this):

        @show="openRoute('/myroute')" @hide="openRoute('/myroute')"
        
        

        with a method defined in my file that takes care of this:

        openRoute (route) {
              this.$router.push(route)
            }
        

        The bad part about this is that now the expansion item no longer realizes when it is active, so I will have to add some logic to take care of the active class as well. This whole thing would be made much easier if q-expansion item just allowed both routes and open actions at the same time natively.

        1 Reply Last reply Reply Quote 0
        • s.molinari
          s.molinari last edited by s.molinari

          @ssuess - Did you try it the other way around? Use the to prop and use the @click event to open and close the item?

          Scott

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

            I will try that @s-molinari thanks for the suggestion

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

              @s-molinari thanks! Your simple suggestion has actually allowed me to solve this problem AND the tree expansion problem here: https://forum.quasar-framework.org/topic/3403/v1-q-expansion-item-open-tree-when-route-is-active

              1 Reply Last reply Reply Quote 1
              • s.molinari
                s.molinari last edited by

                Great! Always glad when I can help! 😄

                Scott

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post