Q select (dynamic values for option)
-
How to bind the dynamic values for “options” in “q -select” component from the back end ? how to proceed further ?
-
your would need to send an ajax request to your backend
and then assign those values from the response to your data part. -
the problem is with binding the values from backend to “:options” in qselect ? how to proceed in this
-
you would need an ajax library like axios:
check this:
http://quasar-framework.org/guide/ajax-requests.htmlthis.$http.get('/user') .then(function (response) { this.data.options = response.data })
as an example…
-
To expand on what @Max said:
<template> <div> <q-select v-model="value" :options="options"></q-select> </div> </template> <script> import { QSelect } from 'quasar' export default { components: { QSelect }, data() { return { options: [], value: '' } }, mounted () { this.$http.get('/Route') .then(response => { this.options = response.data }) } } </script>