This commit is contained in:
j3d1 2024-05-22 21:34:27 +02:00
parent 90da7b5602
commit b3ff77a1fa
2 changed files with 35 additions and 1 deletions

View file

@ -0,0 +1,32 @@
<template>
<div contenteditable>
<pre>{{ value }}</pre>
<span v-html="rawhtml(value)"></span>
</div>
</template>
<script>
export default {
name: 'FormatedText',
props: {
value: {
type: String,
required: true
},
format: {
type: Function,
default: null
}
},
emits: ['input'],
methods: {
rawhtml(value) {
if (typeof format === 'function') {
return format(value);
} else {
return value;
}
}
}
};
</script>