2022-05-28 20:36:58 +02:00
|
|
|
<template>
|
2024-01-27 00:08:23 +01:00
|
|
|
<div class="default-style">
|
2025-01-22 07:53:23 +01:00
|
|
|
<p v-if="label" class="px-1 text-sm font-semibold" :class="{ 'text-gray-400': disabled }" style="margin-top: 0; margin-bottom: 0.125em">
|
2022-05-28 20:36:58 +02:00
|
|
|
{{ label }}
|
|
|
|
</p>
|
2025-01-22 07:53:23 +01:00
|
|
|
<ui-vue-trix ref="input" v-model="content" :disabled-editor="disabled" @trix-file-accept="trixFileAccept" />
|
2022-05-28 20:36:58 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
value: String,
|
|
|
|
label: String,
|
2025-01-22 07:53:23 +01:00
|
|
|
disabled: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
}
|
2022-05-28 20:36:58 +02:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
content: {
|
|
|
|
get() {
|
|
|
|
return this.value
|
|
|
|
},
|
|
|
|
set(val) {
|
|
|
|
this.$emit('input', val)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
trixFileAccept(e) {
|
|
|
|
e.preventDefault()
|
2025-01-22 07:53:23 +01:00
|
|
|
},
|
|
|
|
blur() {
|
|
|
|
if (this.$refs.input && this.$refs.input.blur) {
|
|
|
|
this.$refs.input.blur()
|
|
|
|
}
|
2022-05-28 20:36:58 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {},
|
2023-03-05 19:28:20 +01:00
|
|
|
beforeDestroy() {}
|
2022-05-28 20:36:58 +02:00
|
|
|
}
|
2025-01-22 07:53:23 +01:00
|
|
|
</script>
|