Add another field to Options Group?



  • 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?



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



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


Log in to reply