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-expansion-item conditional class on expanded item

    Help
    4
    9
    1047
    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.
    • Q
      quasy last edited by

      Hi,

      I am trying to have a :class for coloring the background of an expanded item in my q-expansion-item list. So if expanded, it looks one way but if not, it looks like the rest of the items in the list.

      Since this is bound to a v-for (with the items coming from a script array), v-model does not seem to be a workable path.

      Thanks so much for reviewing.

      Quasy

      metalsadman 1 Reply Last reply Reply Quote 0
      • metalsadman
        metalsadman @quasy last edited by

        @quasy a codepen would help.

        1 Reply Last reply Reply Quote 0
        • Q
          quasy last edited by

          @metalsadman - good idea. Thanks much for suggesting

          https://codepen.io/quasy/pen/ExKZrwE

          When any item is expanded, I want to have it stand out with a different, color, etc.

          1 Reply Last reply Reply Quote 0
          • Q
            quasy last edited by

            Is this possible… does anyone know?

            beets 1 Reply Last reply Reply Quote 0
            • beets
              beets @quasy last edited by

              @quasy The class q-expansion-item--expanded is already applied to the expansion item when expanded, why not just use that and target it in css?

              1 Reply Last reply Reply Quote 0
              • Q
                quasy last edited by

                @beets That sounds like exactly what I want but I am too new to this code to know hot to do that. When I try to check for q-expansion-item-expanded or expanded to set a conditional :class, it does not work. Could you please explain further. Sorry to be asking such newbie questions!

                beets 1 Reply Last reply Reply Quote 0
                • G
                  Geita last edited by

                  .q-expansion-item–expanded {
                  color: green;
                  }.

                  1 Reply Last reply Reply Quote 0
                  • beets
                    beets @quasy last edited by

                    @quasy No problem on the question, the idea is that you don’t need to conditionally apply a class, since Quasar already does it. You would add something like this in your css to style the list item:

                    .q-expansion-item--expanded .q-item {
                      background: green;
                    }
                    
                    Q 1 Reply Last reply Reply Quote 0
                    • Q
                      quasy @beets last edited by

                      @beets THANK YOU! Perfect. It looks exactly as I want!! Thanks for being patient with me also.

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