forked from verdnatura/salix-front
fix: cardDescriptor
This commit is contained in:
parent
3a117a9f0e
commit
2e02027a00
|
@ -58,8 +58,8 @@ onBeforeMount(async () => {
|
||||||
store = arrayData.store;
|
store = arrayData.store;
|
||||||
entity = computed(() => {
|
entity = computed(() => {
|
||||||
const data = Array.isArray(store.data) ? store.data[0] : store.data;
|
const data = Array.isArray(store.data) ? store.data[0] : store.data;
|
||||||
emit('onFetch', data);
|
if (data) emit('onFetch', data ?? {});
|
||||||
return data;
|
return data ?? {};
|
||||||
});
|
});
|
||||||
|
|
||||||
// It enables to load data only once if the module is the same as the dataKey
|
// It enables to load data only once if the module is the same as the dataKey
|
||||||
|
|
|
@ -73,7 +73,7 @@ onMounted(async () => {
|
||||||
|
|
||||||
const data = ref(useCardDescription());
|
const data = ref(useCardDescription());
|
||||||
const setData = (entity) =>
|
const setData = (entity) =>
|
||||||
(data.value = useCardDescription(entity.supplier.nickname, entity.id));
|
(data.value = useCardDescription(entity.supplier?.nickname, entity.id));
|
||||||
|
|
||||||
const currentEntry = computed(() => state.get('entry'));
|
const currentEntry = computed(() => state.get('entry'));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue