Skip to content

Commit

Permalink
feat(editor): add el-tiptap readonly prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Leecason committed Jan 8, 2020
1 parent 91d2c80 commit 9949163
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/ElementTiptap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ export default {
return ['html', 'json'].includes(output);
},
},
readonly: {
type: Boolean,
default: false,
},
},
data () {
Expand All @@ -121,6 +126,12 @@ export default {
if (this.editor) this.editor.setContent(val);
},
readonly () {
this.editor.setOptions({
editable: !this.readonly,
});
},
},
mounted () {
Expand All @@ -134,6 +145,7 @@ export default {
}, {});
this.editor = new Editor({
editable: !this.readonly,
useBuiltInExtensions: false,
extensions,
content: this.content,
Expand Down

0 comments on commit 9949163

Please sign in to comment.