From 1db3c146b931ce0e9642b25aa742d74baf51dc80 Mon Sep 17 00:00:00 2001 From: Kamila Date: Fri, 26 Jul 2024 09:44:00 +0200 Subject: [PATCH] move logic to component to make it dynamically updated --- admin/src/components/CreationFormular.vue | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/admin/src/components/CreationFormular.vue b/admin/src/components/CreationFormular.vue index ee73b0749..a732dc6ea 100644 --- a/admin/src/components/CreationFormular.vue +++ b/admin/src/components/CreationFormular.vue @@ -8,7 +8,7 @@ ({}), }, + creation: { + type: Object, + required: true, + }, }) const { t } = useI18n() @@ -127,7 +131,14 @@ const selected = ref() const creationForm = ref(null) const openCreations = computed(() => store.state.openCreations) - +const radioOptions = computed(() => { + return creationDateObjects.value.map((obj, idx) => { + return { + item: { ...obj, creation: props.creation[idx] }, + name: obj.short + (props.creation[idx] ? ' ' + props.creation[idx] + ' GDD' : ''), + } + }) +}) const updateRadioSelected = (name) => { text.value = `${t('creation_form.creation_for')} ${name?.short} ${name?.year}` rangeMin.value = 0