From e044b015369bfe2b6c7005fcc95be5a3e150db07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Kol=C3=A1=C5=99?= Date: Sun, 17 May 2020 17:25:02 +0300 Subject: [PATCH 1/2] feat: add disabled flag feat: add disabled flag feat: add disabled flag lint typo remove doubled prop lint typo --- README.md | 11 +++++++++++ src/components/ActionsRender.vue | 7 ++++++- src/components/TiptapVuetify.vue | 10 ++++++++++ src/components/Toolbar.vue | 4 ++++ src/const.ts | 3 ++- .../actions/renders/btn/ExtensionActionRenderBtn.vue | 7 ++++++- 6 files changed, 39 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2520d50..e1c1897 100644 --- a/README.md +++ b/README.md @@ -342,6 +342,17 @@ For example, to get json instead: /> ``` +### disabled + +Flag for disabling entire editor (disabled toolbar items and [ready-only](https://tiptap.scrumpy.io/read-only) content area). Default false. + +For example, disabled editor by component prop: +```vue + +``` + ## Events ### init diff --git a/src/components/ActionsRender.vue b/src/components/ActionsRender.vue index 3d00894..5929540 100644 --- a/src/components/ActionsRender.vue +++ b/src/components/ActionsRender.vue @@ -8,6 +8,7 @@ :context="$props[PROPS.CONTEXT]" :editor="$props[PROPS.EDITOR]" :dark="$props[PROPS.DARK]" + :disabled="$props[PROPS.DISABLED]" /> @@ -25,7 +26,8 @@ export const PROPS = { EDITOR: 'editor' as const, ACTIONS: 'actions' as const, CONTEXT: 'context' as const, - DARK: 'dark' as const + DARK: 'dark' as const, + DISABLED: 'disabled' as const } @Component({ @@ -37,6 +39,9 @@ export default class ActionsRender extends Vue { @Prop({ type: Object, required: true }) readonly [PROPS.EDITOR]: Editor + @Prop({ type: Boolean, default: false }) + readonly [PROPS.DISABLED]: boolean + @Prop({ type: Array, default: () => [] diff --git a/src/components/TiptapVuetify.vue b/src/components/TiptapVuetify.vue index e175984..137f205 100644 --- a/src/components/TiptapVuetify.vue +++ b/src/components/TiptapVuetify.vue @@ -20,6 +20,7 @@ :editor="editor" :actions="availableActions.toolbar" :toolbar-attributes="$props[PROPS.TOOLBAR_ATTRIBUTES]" + :disabled="$props[PROPS.DISABLED]" >