hotFix: vnSelectFilter
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
This commit is contained in:
parent
67982b3bbb
commit
72d51a53a8
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue