[Vuejs]-Quasar q-checkbox get target value if checked

1👍

If I understood you correctly, maybe you don’t need function at all :

const { ref } = Vue
const app = Vue.createApp({
  setup () {
    const full_services = ref( ['aaa', 'bbb', 'ccc'] )
    const form = ref( { selected_full_services: [] } )
    return { form, full_services }
  }
})

app.use(Quasar)
app.mount('#q-app')
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons" rel="stylesheet" type="text/css">
<link href="https://cdn.jsdelivr.net/npm/quasar@2.10.1/dist/quasar.prod.css" rel="stylesheet" type="text/css">
<div id="q-app">
{{form}}
  <div v-for="full_service in full_services">
    <q-checkbox
      :label="full_service"
      v-model="form.selected_full_services"
      :val="full_service" />
  </div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@3/dist/vue.global.prod.js"></script>
<script src="https://cdn.jsdelivr.net/npm/quasar@2.10.1/dist/quasar.umd.prod.js"></script>

Leave a comment