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

    Add another field to Options Group?

    Framework
    2
    3
    221
    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.
    • O
      omgwalt last edited by

      Is there a way to add another field to an options group? For instance, if I have:

      <template>
        <div class="q-pa-md" style="max-width: 400px">
      
          <q-form
            class="q-gutter-md"
          >
              <q-input
              filled
              v-model="field"
              label="Field"
              @click="trigger"
              />
      
              <q-option-group
              v-model="group"
              :options="options"
              color="green"
              type="checkbox"
              @click="trigger"
              />
          </q-form>
      
        </div>
      </template>
      
      <script>
      export default {
          data () {
              return {
                  group: [],
                  options: [
                      {
                      label: 'Weed',
                      value: ' weed'
                      },
                      {
                      label: 'Feed',
                      value: ' feed'
                      },
                      {
                      label: 'Clean',
                      value: ' clean'
                      }
                  ]
              }
          },
      
          computed: {
              field () {
                  return this.group
              }
          },
      
          methods: {
              trigger () {
                  console.log("triggered")
              },
      
              onReset () {
              
              }
          }
      }
      </script>
      

      and I want to add a price input field so that each row shows:

      [checkbox] - label field - price field

      in a row, is there a way to accomplish this using option groups?

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

        @omgwalt you could just include it in your label property.

        1 Reply Last reply Reply Quote 0
        • O
          omgwalt last edited by

          What do you mean? How do you include a field in a label?

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