refactor: refs #8113 fine tunning processData
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-11-25 16:57:15 +01:00
parent 7fdcb1eace
commit f32c08bd1d
2 changed files with 2 additions and 2 deletions

View File

@ -76,7 +76,7 @@ const props = defineProps({
},
mapKey: {
type: String,
default: 'id',
default: '',
},
});
const emit = defineEmits(['onFetch', 'onPaginate', 'onChange']);

View File

@ -290,7 +290,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
}
if (!map && !append) store.data = data;
else if (!map && append) store.data.push(...data);
else if (!map && append) for (const row of data) store.data.push(row);
else
data.forEach((row) => {
const key = row[store.mapKey];