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

    Adding custom 'id' properties to dropdown elements divs in QSelect, QAutocomplete

    Help
    2
    6
    323
    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.
    • M
      mas last edited by mas

      Is there a simple way to add a custom id to drop-down elements in QSelect, QAutocomplete? Like, I have a drop-down list ‘cats’, ‘dogs’, ‘pigs’ and I want to add id=‘catsId’ , id=‘dogsId’, id=‘pigsId’ property to each option <div>.

      Thank you!

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

        What do you need it for? Maybe there is another way to get done, what you want to get done?

        Scott

        1 Reply Last reply Reply Quote 0
        • M
          mas last edited by mas

          @s.molinari, for testing) In certain cases unique ids seem to be the most convenient way.

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

            Well, it’s probably not the simple method you are looking for, but you are offered the scoped slot option, where you can design the select options as you please. I’d suggest trying that out.

            Scott

            1 Reply Last reply Reply Quote 0
            • M
              mas last edited by

              @s.molinari, yes, I’ve been trying to avoid using slots and from what you say I see this is the only way if I want to proceed with ids. Thank you!

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

                Slots are a mighty powerful part of Vue. You shouldn’t avoid them. You should embrace them, as they are often used in Quasar and give you the most flexibility. 😄

                Scott

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