0
0
Fork 0
This commit is contained in:
Carlos Satorres 2024-01-25 12:21:41 +01:00
parent 8f870f8d67
commit 33332a5c04
2 changed files with 5 additions and 3 deletions

View File

@ -81,6 +81,7 @@ const filter = (val, options) => {
const filterHandler = (val, update) => { const filterHandler = (val, update) => {
update( update(
() => { () => {
if ($props.url) return;
if ($props.defaultFilter) if ($props.defaultFilter)
myOptions.value = filter(val, myOptionsOriginal.value); myOptions.value = filter(val, myOptionsOriginal.value);
}, },
@ -100,13 +101,13 @@ watch(options, (newValue) => {
<template> <template>
<FetchData <FetchData
v-if="$props.url"
ref="dataRef" ref="dataRef"
:url="$props.url" :url="$props.url"
@on-fetch="(data) => (dataRef = data)" @on-fetch="(data) => setOptions(data)"
auto-load auto-load
/> />
<QSelect <QSelect
v-if="dataRef"
v-model="value" v-model="value"
:options="myOptions" :options="myOptions"
:option-label="optionLabel" :option-label="optionLabel"

View File

@ -200,7 +200,8 @@ function supplierRefFilter(val) {
<VnSelectFilter <VnSelectFilter
:label="t('supplierFk')" :label="t('supplierFk')"
v-model="data.supplierFk" v-model="data.supplierFk"
option-value="id" option-value="id
"
option-label="nickname" option-label="nickname"
url="Suppliers" url="Suppliers"
:filter="{ fields: ['id', 'code'], order: 'code' }" :filter="{ fields: ['id', 'code'], order: 'code' }"