Files
mareike/app/Views/Components/TextResource.vue
2026-04-26 01:56:28 +02:00

28 lines
529 B
Vue

<script setup>
import {onMounted, reactive} from "vue";
const props = defineProps({
textName: { type: String},
belongsTo: { type: String},
})
const contentData = reactive({
content: '',
});
onMounted(async () => {
const response = await fetch('/api/v1/core/retrieve-text-resource/' + props.textName);
const data = await response.json();
Object.assign(contentData, data);
});
</script>
<template>
<label :for="props.belongsTo">{{contentData.content}}</label>
</template>
<style scoped>
</style>