MealPlan editor in new editor system

This commit is contained in:
vabene1111
2024-10-08 19:23:20 +02:00
parent 9395a456f0
commit 4f425fb99a
38 changed files with 203 additions and 10 deletions

View File

@@ -20,15 +20,18 @@
<script setup lang="ts">
import {useRouter} from "vue-router";
import {EditorSupportedModels} from "@/types/Models";
import {EditorSupportedModels, getGenericModelFromString} from "@/types/Models";
import {defineAsyncComponent, PropType, shallowRef} from "vue";
import {useI18n} from "vue-i18n";
const {t} = useI18n()
const props = defineProps({
model: {type: String as PropType<EditorSupportedModels>, required: true},
id: {type: String, required: false, default: undefined},
})
const editorComponent = shallowRef(defineAsyncComponent(() => import(`@/components/model_editors/${props.model}Editor.vue`)))
const editorComponent = shallowRef(defineAsyncComponent(() => import(`@/components/model_editors/${getGenericModelFromString(props.model, t).model.name}Editor.vue`)))
const router = useRouter()