rudeshark.net/packages/client/src/components/page/page.textarea.vue

25 lines
510 B
Vue
Raw Normal View History

2019-04-30 05:15:41 +02:00
<template>
2021-08-06 15:29:19 +02:00
<MkTextarea :model-value="text" readonly></MkTextarea>
2019-04-30 05:15:41 +02:00
</template>
<script lang="ts" setup>
import { watch } from 'vue';
import MkTextarea from '../form/textarea.vue';
2021-11-11 18:02:25 +01:00
import { TextBlock } from '@/scripts/hpml/block';
import { Hpml } from '@/scripts/hpml/evaluator';
2019-04-30 05:15:41 +02:00
const props = defineProps<{
block: TextBlock;
hpml: Hpml;
}>();
let text = $ref('');
watch(props.hpml.vars, () => {
text = props.hpml.interpolate(props.block.text) as string;
}, {
deep: true,
immediate: true,
2019-04-30 05:15:41 +02:00
});
</script>