From 478ca62329dedde895bd4f9c84a84543d6f6a772 Mon Sep 17 00:00:00 2001 From: Dennis Date: Thu, 7 Nov 2019 13:52:07 +0100 Subject: [PATCH] Added a min- and maxHeight attributes --- src/components/TiptapVuetify.vue | 18 +++++++++++++++++- src/const.ts | 4 +++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/components/TiptapVuetify.vue b/src/components/TiptapVuetify.vue index 5115e8d..72f3d38 100644 --- a/src/components/TiptapVuetify.vue +++ b/src/components/TiptapVuetify.vue @@ -36,7 +36,10 @@ -
+
@@ -112,6 +115,12 @@ export default class TiptapVuetify extends Vue { }) readonly [PROPS.TYPE]: EDITOR_TYPES_ENUM + @Prop({ type: Number }) + readonly [PROPS.MIN_HEIGHT]: number + + @Prop({ type: Number }) + readonly [PROPS.MAX_HEIGHT]: number + PROPS = PROPS EDITOR_TYPES_ENUM = EDITOR_TYPES_ENUM editor: Editor | null = null @@ -132,6 +141,13 @@ export default class TiptapVuetify extends Vue { return this[PROPS.EXTENSIONS].filter(i => i.renderIn) } + get contentDynamicStyles () { + let dynamicStylesToReturn = {} + if (this[PROPS.MIN_HEIGHT]) Object.assign(dynamicStylesToReturn, { minHeight: `${this[PROPS.MIN_HEIGHT]}px` }) + if (this[PROPS.MAX_HEIGHT]) Object.assign(dynamicStylesToReturn, { maxHeight: `${this[PROPS.MAX_HEIGHT]}px` }) + return dynamicStylesToReturn + } + @Watch('value') onValueChange (val) { if (this.emitAfterOnUpdate) { diff --git a/src/const.ts b/src/const.ts index e0cdf13..6c6ab7b 100644 --- a/src/const.ts +++ b/src/const.ts @@ -16,7 +16,9 @@ export const PROPS = { PLACEHOLDER: 'placeholder' as const, CARD_PROPS: 'cardProps' as const, OUTPUT_FORMAT: 'outputFormat' as const, - TYPE: 'type' as const + TYPE: 'type' as const, + MIN_HEIGHT: 'minHeight' as const, + MAX_HEIGHT: 'maxHeight' as const } export enum EDITOR_TYPES_ENUM {