2019-04-30 05:15:41 +02:00
|
|
|
<template>
|
2020-10-17 13:12:00 +02:00
|
|
|
<MkTextarea :value="text" readonly></MkTextarea>
|
2019-04-30 05:15:41 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-01-30 02:59:05 +01:00
|
|
|
import { TextBlock } from '@/scripts/hpml/block';
|
|
|
|
import { Hpml } from '@/scripts/hpml/evaluator';
|
|
|
|
import { defineComponent, PropType } from 'vue';
|
2020-01-29 20:37:25 +01:00
|
|
|
import MkTextarea from '../ui/textarea.vue';
|
2019-04-30 05:15:41 +02:00
|
|
|
|
2020-10-17 13:12:00 +02:00
|
|
|
export default defineComponent({
|
2020-01-29 20:37:25 +01:00
|
|
|
components: {
|
|
|
|
MkTextarea
|
|
|
|
},
|
2019-04-30 05:15:41 +02:00
|
|
|
props: {
|
2021-01-30 02:59:05 +01:00
|
|
|
block: {
|
|
|
|
type: Object as PropType<TextBlock>,
|
2019-04-30 05:15:41 +02:00
|
|
|
required: true
|
|
|
|
},
|
2020-04-20 14:35:27 +02:00
|
|
|
hpml: {
|
2021-01-30 02:59:05 +01:00
|
|
|
type: Object as PropType<Hpml>,
|
2019-04-30 05:15:41 +02:00
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2021-01-30 02:59:05 +01:00
|
|
|
text: this.hpml.interpolate(this.block.text),
|
2019-04-30 05:15:41 +02:00
|
|
|
};
|
|
|
|
},
|
2020-01-29 20:37:25 +01:00
|
|
|
watch: {
|
2020-04-20 14:35:27 +02:00
|
|
|
'hpml.vars': {
|
2020-01-29 20:37:25 +01:00
|
|
|
handler() {
|
2021-01-30 02:59:05 +01:00
|
|
|
this.text = this.hpml.interpolate(this.block.text);
|
2020-01-29 20:37:25 +01:00
|
|
|
},
|
|
|
|
deep: true
|
|
|
|
}
|
2019-04-30 05:15:41 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|