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