audiobookshelf/client/components/ui/RichTextEditor.vue

47 lines
902 B
Vue
Raw Normal View History

<template>
<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">
{{ 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" />
</div>
</template>
<script>
export default {
props: {
value: String,
label: String,
2025-01-22 07:53:23 +01:00
disabled: {
type: Boolean,
default: false
}
},
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()
}
}
},
mounted() {},
beforeDestroy() {}
}
2025-01-22 07:53:23 +01:00
</script>