Newer
Older

Дмитрий Малюгин
committed
<script setup lang="ts">
import type { IEntity } from '@/app/interfaces/environment';
import type { IImage, IText } from '@/app/interfaces/entities';

Дмитрий Малюгин
committed
interface Props {
entity: IEntity;
}
const props = defineProps<Props>();
const emit = defineEmits(['update:entityData']);
const entity = useVModel(props, 'entity', emit);

Дмитрий Малюгин
committed
</script>
<template>
<div>
<TextItem v-if="entity.entity_type === 'text'" :entityData="entity as IText" />
<ImageItem v-if="entity.entity_type === 'image'" v-model:entityData="entity as IImage" />

Дмитрий Малюгин
committed
</div>
</template>
<style scoped></style>