fix(CrudModel, VnSelect): improve loading state handling and condition checks
gitea/salix-front/pipeline/pr-master Something is wrong with the build of this commit Details

This commit is contained in:
Alex Moreno 2025-04-16 09:52:30 +02:00
parent 71ae35be26
commit 650b205a04
2 changed files with 4 additions and 5 deletions

View File

@ -299,7 +299,7 @@ watch(formUrl, async () => {
</script>
<template>
<SkeletonTable
v-if="!formData && ($attrs['auto-load'] == '' || $attrs['auto-load'])"
v-if="!formData && ($attrs['auto-load'] === '' || $attrs['auto-load'])"
:columns="$attrs.columns?.length"
/>
<VnPaginate

View File

@ -183,8 +183,7 @@ const arrayData = useArrayData(arrayDataKey, {
searchUrl: false,
mapKey: $attrs['map-key'],
});
const arrayDataIsLoading = computed(() => arrayData.isLoading);
const someIsLoading = computed(() => isLoading.value || arrayData.isLoading);
function findKeyInOptions() {
if (!$props.options) return;
return filter($props.modelValue, $props.options)?.length;
@ -367,8 +366,8 @@ function getCaption(opt) {
virtual-scroll-slice-size="options.length"
hide-bottom-space
:input-debounce="useURL ? '300' : '0'"
:loading="isLoading || arrayDataIsLoading"
:disable="isLoading || arrayDataIsLoading"
:loading="someIsLoading"
:disable="someIsLoading"
@virtual-scroll="onScroll"
@keydown="handleKeyDown"
:data-cy="$attrs.dataCy ?? $attrs.label + '_select'"