mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-12-20 17:48:11 +09:00
14148f6c4a
Resolve #7779
40 lines
732 B
Vue
40 lines
732 B
Vue
<template>
|
|
<MkTextarea :model-value="text" readonly></MkTextarea>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { TextBlock } from '@/scripts/hpml/block';
|
|
import { Hpml } from '@/scripts/hpml/evaluator';
|
|
import { defineComponent, PropType } from 'vue';
|
|
import MkTextarea from '../form/textarea.vue';
|
|
|
|
export default defineComponent({
|
|
components: {
|
|
MkTextarea
|
|
},
|
|
props: {
|
|
block: {
|
|
type: Object as PropType<TextBlock>,
|
|
required: true
|
|
},
|
|
hpml: {
|
|
type: Object as PropType<Hpml>,
|
|
required: true
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
text: this.hpml.interpolate(this.block.text),
|
|
};
|
|
},
|
|
watch: {
|
|
'hpml.vars': {
|
|
handler() {
|
|
this.text = this.hpml.interpolate(this.block.text);
|
|
},
|
|
deep: true
|
|
}
|
|
}
|
|
});
|
|
</script>
|