add loading state

This commit is contained in:
Philipp Kühn 2019-05-03 22:14:18 +02:00
parent fd404f5c1f
commit 2475bf6123

View File

@ -1,6 +1,9 @@
<template> <template>
<div class="editor"> <div class="editor">
<editor-content class="editor__content" :editor="editor" v-if="editor" /> <editor-content class="editor__content" :editor="editor" v-if="editor && !loading" />
<em v-else>
Connecting to socket server
</em>
</div> </div>
</template> </template>
@ -19,6 +22,7 @@ export default {
data() { data() {
return { return {
loading: true,
editor: null, editor: null,
socket: null, socket: null,
} }
@ -26,6 +30,8 @@ export default {
methods: { methods: {
initEditor({ doc, version }) { initEditor({ doc, version }) {
this.loading = false
if (this.editor) { if (this.editor) {
this.editor.destroy() this.editor.destroy()
} }