VnSelect loading

This commit is contained in:
William Buezas 2024-12-05 10:12:18 -03:00
parent 65923fee9f
commit 41196b4a23
2 changed files with 22 additions and 11 deletions

View File

@ -129,6 +129,8 @@ async function filterHandler(val, update) {
if (!$props.defaultFilter) return update(); if (!$props.defaultFilter) return update();
const newOptions = filter(val, myOptionsOriginal.value); const newOptions = filter(val, myOptionsOriginal.value);
setTimeout(() => {
update( update(
() => { () => {
myOptions.value = newOptions; myOptions.value = newOptions;
@ -140,6 +142,7 @@ async function filterHandler(val, update) {
} }
} }
); );
}, 300);
} }
</script> </script>
@ -178,6 +181,13 @@ async function filterHandler(val, update) {
> >
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" /> <slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
</template> </template>
<template #no-option>
<QItem>
<QItemSection class="text-grey">
{{ t('emptyList') }}
</QItemSection>
</QItem>
</template>
</QSelect> </QSelect>
</template> </template>

View File

@ -760,7 +760,8 @@ const getSubcategories = async () => {
DROP TEMPORARY TABLE tmp.itemAvailable;`, DROP TEMPORARY TABLE tmp.itemAvailable;`,
{ orderId: basketOrderId.value } { 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) { } catch (error) {
console.error('Error getting subcategories:', error); console.error('Error getting subcategories:', error);
} }