hotFix: vnSelectFilter
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2024-02-15 14:53:43 +01:00
parent 67982b3bbb
commit 72d51a53a8
1 changed files with 7 additions and 7 deletions

View File

@ -79,7 +79,7 @@ onMounted(() => {
if ($props.url && $props.modelValue) fetchFilter($props.modelValue); if ($props.url && $props.modelValue) fetchFilter($props.modelValue);
}); });
async function filter(val, options) { function filter(val, options) {
const search = val.toString().toLowerCase(); const search = val.toString().toLowerCase();
if (!search) return options; if (!search) return options;
@ -111,15 +111,15 @@ async function fetchFilter(val) {
return dataRef.value.fetch({ fields, where, order: sortBy, limit }); return dataRef.value.fetch({ fields, where, order: sortBy, limit });
} }
async function filterHandler(val, update) { function filterHandler(val, update) {
update( update(
async () => { async () => {
if (!$props.defaultFilter) return; if (!$props.defaultFilter) return;
if ($props.url) { // if ($props.url) {
myOptions.value = await fetchFilter(val); // myOptions.value = await fetchFilter(val);
return; // return;
} // }
myOptions.value = await filter(val, myOptionsOriginal.value); myOptions.value = filter(val, myOptionsOriginal.value);
}, },
(ref) => { (ref) => {
if (val !== '' && ref.options.length > 0) { if (val !== '' && ref.options.length > 0) {