QSELECT dynamic model
-
I have a QSelect whose model and options depend on a dynamic property:
<q-item-section> <template v-if="property.AvailableValues.length > 0"> <q-select dense v-model="property.Value" label="test" :options="property.AvailableValues" option-value="Value" option-label="Text" options-dense map-options emit-value use-input input-debounce="0" @@filter="filterAvailableValues" @@new-value="createContentPropertyValue"> </q-select> </template> <template v-else> <q-input dense v-model="property.Value" label="Property string Value"></q-input> </template> </q-item-section>
Using text box, I want to add new value if not present into the “property.AvailableValues”. To do this I have to use the event @@new-value, and push the new value into options array/list.
But how can I do that, since options list (property.AvailableValues) is dynamic (i.e. not present in vue data)? -
@jj said in QSELECT dynamic model:
But how can I do that, since options list (property.AvailableValues) is dynamic (i.e. not present in vue data)?
You mean the
property.AvailableValues
is defined in it’s parent component? If not where is it defined? -
Yes it is defined in it’s parent component
-
If you want better support please create a working codepen.io that demo’s your problem.