VnSelect loading
This commit is contained in:
parent
65923fee9f
commit
41196b4a23
|
@ -129,17 +129,20 @@ async function filterHandler(val, update) {
|
|||
|
||||
if (!$props.defaultFilter) return update();
|
||||
const newOptions = filter(val, myOptionsOriginal.value);
|
||||
update(
|
||||
() => {
|
||||
myOptions.value = newOptions;
|
||||
},
|
||||
ref => {
|
||||
if (val !== '' && ref.options.length > 0) {
|
||||
ref.setOptionIndex(-1);
|
||||
ref.moveOptionSelection(1, true);
|
||||
|
||||
setTimeout(() => {
|
||||
update(
|
||||
() => {
|
||||
myOptions.value = newOptions;
|
||||
},
|
||||
ref => {
|
||||
if (val !== '' && ref.options.length > 0) {
|
||||
ref.setOptionIndex(-1);
|
||||
ref.moveOptionSelection(1, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
);
|
||||
}, 300);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -178,6 +181,13 @@ async function filterHandler(val, update) {
|
|||
>
|
||||
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
||||
</template>
|
||||
<template #no-option>
|
||||
<QItem>
|
||||
<QItemSection class="text-grey">
|
||||
{{ t('emptyList') }}
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
</QSelect>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -760,7 +760,8 @@ const getSubcategories = async () => {
|
|||
DROP TEMPORARY TABLE tmp.itemAvailable;`,
|
||||
{ orderId: basketOrderId.value }
|
||||
);
|
||||
itemSubcategories.value = res.results[1].data;
|
||||
const filtered = res.results[1].data.filter(item => item.category);
|
||||
itemSubcategories.value = filtered.map(i => i.category);
|
||||
} catch (error) {
|
||||
console.error('Error getting subcategories:', error);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue