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

    Radio in v-for dynamically created

    Help
    2
    2
    763
    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
      qqqwww last edited by

      I’m trying to dynamically create radio element with server data and v-for, but radio buttons don’t work properly

        <q-item v-for="(item3, index) in MyValues">
           <q-radio v-model="item3.model" :val="item3.val" :label="item3.label"></q-radio>
        </q-item>
      

      json data
      MyValues: [{label: “Radio 1”, model: “selectedIndex”, val:2}, {label: “Radio 2”, model: “selectedIndex”, val:3}]

      After creating both of radio buttons checked and can’t be unchecked. Pls help.

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

        Radios are usually a type of selection. In other words, they all share the same model and only one can be selected at any one time. So, you giving them all different models won’t work.

        I think what you are looking for are toggles.

        https://quasar-framework.org/components/toggle.html

        Scott

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