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

    How to control the sublabel color of `q-collapsible`?

    Help
    2
    3
    352
    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.
    • F
      flight9 last edited by flight9

      I would like to change the sublabel color of q-collapsible and control it by a varible.

      I only found there is a property header-class="text-red" which can control the label color, but not the sublabel.

      My code is like this:

      <q-collapsible icon="fa fa-square"
                    :label="itselfStatus.node.tagValue.value"
                    :sublabel="itselfStatus.valid ? $t('OK') : $t('failed')"
      >
      ....
      </q-collapsible>
      

      0_1548058697243_collapsible-121161223154.jpg

      N 1 Reply Last reply Reply Quote 0
      • N
        Narmer23 @flight9 last edited by

        @flight9 You can use the Header slot to fully customize the header. JSFiddle as an example.

        1 Reply Last reply Reply Quote 0
        • F
          flight9 last edited by

          @Narmer23 thanks, I found solution, here are some codes for others to ref later:

          <q-collapsible>
                          <template slot="header">
                            <q-item-side icon="fa fa-square" />
                            <q-item-main>
                              <q-item-tile :label="true">
                                {{ itselfStatus.node && itselfStatus.node.tagValue.value }}
                              </q-item-tile>
                              <q-item-tile :sublabel="true" :color="itselfStatus.valid ? 'positive' : 'negative'" >
                                {{ itselfStatus.valid ? $t('OK') : $t('failed') }}
                              </q-item-tile>
                            </q-item-main>
                            <q-item-side>
                              {{ !itselfStatus.valid && itselfStatus.forcible ? 'forcible': ''}}
                            </q-item-side>
                          </template>
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post