stash
This commit is contained in:
parent
90da7b5602
commit
b3ff77a1fa
2 changed files with 35 additions and 1 deletions
32
web/src/components/inputs/FormatedText.vue
Normal file
32
web/src/components/inputs/FormatedText.vue
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue