mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-21 13:15:10 +01:00
63df2c851e
Co-authored-by: tamaina <tamaina@hotmail.co.jp>
45 lines
947 B
Vue
45 lines
947 B
Vue
<template>
|
|
<div>
|
|
<MkTextarea :model-value="value" @update:model-value="updateValue($event)">
|
|
<template #label>{{ hpml.interpolate(block.text) }}</template>
|
|
</MkTextarea>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { computed, defineComponent, PropType } from 'vue';
|
|
import MkTextarea from '../MkTextarea.vue';
|
|
import { Hpml } from '@/scripts/hpml/evaluator';
|
|
import { TextInputVarBlock } from '@/scripts/hpml/block';
|
|
|
|
export default defineComponent({
|
|
components: {
|
|
MkTextarea,
|
|
},
|
|
props: {
|
|
block: {
|
|
type: Object as PropType<TextInputVarBlock>,
|
|
required: true,
|
|
},
|
|
hpml: {
|
|
type: Object as PropType<Hpml>,
|
|
required: true,
|
|
},
|
|
},
|
|
setup(props, ctx) {
|
|
const value = computed(() => {
|
|
return props.hpml.vars.value[props.block.name];
|
|
});
|
|
|
|
function updateValue(newValue) {
|
|
props.hpml.updatePageVar(props.block.name, newValue);
|
|
props.hpml.eval();
|
|
}
|
|
|
|
return {
|
|
value,
|
|
updateValue,
|
|
};
|
|
},
|
|
});
|
|
</script>
|