36 lines
1.0 KiB
Vue
36 lines
1.0 KiB
Vue
<script setup lang="ts">
|
|
import InsertTemplateComponent from '@components/common/InsertTemplateComponent.vue';
|
|
import { ref } from 'vue';
|
|
|
|
const value = ref('')
|
|
|
|
const props = defineProps(
|
|
{
|
|
prettyName: {type: String, required: true},
|
|
xmlData: {type: String},
|
|
}
|
|
)
|
|
const emit = defineEmits(['update'])
|
|
|
|
function sendValue() {
|
|
emit('update', value.value)
|
|
}
|
|
|
|
function setToDefaultValue(data: string) {
|
|
value.value = data;
|
|
sendValue();
|
|
}
|
|
|
|
</script>
|
|
|
|
<template>
|
|
<div class="flex flex-col w-full h-1/2">
|
|
<div class="flex place-content-between w-full pr-2 items-center m-2">
|
|
<span class="dark:text-white">{{ prettyName }}</span>
|
|
<div class="flex space-x-2">
|
|
<InsertTemplateComponent :pretty-name="props.prettyName" @update:default-data="(data: string) => setToDefaultValue(data)"></InsertTemplateComponent>
|
|
</div>
|
|
</div>
|
|
<textarea id="xmlField" v-model="value" @input="sendValue()" class="text-field"></textarea>
|
|
</div>
|
|
</template> |