diff options
Diffstat (limited to 'app/assets/javascripts/blob/components/blob_edit_content.vue')
-rw-r--r-- | app/assets/javascripts/blob/components/blob_edit_content.vue | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/app/assets/javascripts/blob/components/blob_edit_content.vue b/app/assets/javascripts/blob/components/blob_edit_content.vue index 83303a373f3..9a30ed93330 100644 --- a/app/assets/javascripts/blob/components/blob_edit_content.vue +++ b/app/assets/javascripts/blob/components/blob_edit_content.vue @@ -5,7 +5,8 @@ export default { props: { value: { type: String, - required: true, + required: false, + default: '', }, fileName: { type: String, @@ -15,7 +16,6 @@ export default { }, data() { return { - content: this.value, editor: null, }; }, @@ -28,14 +28,12 @@ export default { this.editor = initEditorLite({ el: this.$refs.editor, blobPath: this.fileName, - blobContent: this.content, + blobContent: this.value, }); }, methods: { triggerFileChange() { - const val = this.editor.getValue(); - this.content = val; - this.$emit('input', val); + this.$emit('input', this.editor.getValue()); }, }, }; @@ -43,7 +41,7 @@ export default { <template> <div class="file-content code"> <pre id="editor" ref="editor" data-editor-loading @focusout="triggerFileChange">{{ - content + value }}</pre> </div> </template> |