39 lines
845 B
Vue
39 lines
845 B
Vue
<script setup>
|
|
import { ref } from 'vue';
|
|
import VnDescriptor from './VnDescriptor.vue';
|
|
|
|
const $props = defineProps({
|
|
id: {
|
|
type: Number,
|
|
default: false,
|
|
},
|
|
card: {
|
|
type: Object,
|
|
default: null,
|
|
},
|
|
});
|
|
|
|
const emit = defineEmits(['onFetch']);
|
|
const entity = ref();
|
|
</script>
|
|
|
|
<template>
|
|
<component
|
|
:is="card"
|
|
:id
|
|
:visual="false"
|
|
v-bind="$attrs"
|
|
@on-fetch="
|
|
(data) => {
|
|
entity = data;
|
|
emit('onFetch', data);
|
|
}
|
|
"
|
|
/>
|
|
<VnDescriptor v-model="entity" v-bind="$attrs">
|
|
<template v-for="(_, slotName) in $slots" #[slotName]="slotData" :key="slotName">
|
|
<slot :name="slotName" v-bind="slotData ?? {}" :key="slotName" />
|
|
</template>
|
|
</VnDescriptor>
|
|
</template>
|