Skip to content
Snippets Groups Projects
EntityItem.vue 675 B
Newer Older
import type { IEntity } from '@/app/interfaces/environment';
import { useVModel } from '@vueuse/core';
import type { IImage, IText } from '@/app/interfaces/entities';
const props = defineProps<Props>();
const emit = defineEmits(['update:entityData']);
const entity = useVModel(props, 'entity', emit);
    <TextItem v-if="entity.entity_type === 'text'" :entityData="entity as IText" />
    <ImageItem v-if="entity.entity_type === 'image'" v-model:entityData="entity as IImage" />
    <div class="px-16">
      <BaseDivider />