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

View File

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