refs #6677 VnSelectFilter add url prop #164

Merged
carlossa merged 8 commits from 6677-urlSelectFilter into dev 2024-01-31 14:42:43 +00:00
2 changed files with 5 additions and 3 deletions
Showing only changes of commit 33332a5c04 - Show all commits

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
carlossa marked this conversation as resolved
Review

...

...
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' }"