fix drawing example

This commit is contained in:
Hans Pagel
2021-01-08 18:20:48 +01:00
parent 5320d8ff66
commit e2a7f888e7

View File

@@ -21,12 +21,13 @@ export default {
data() { data() {
return { return {
editor: null, editor: null,
provider: null,
} }
}, },
mounted() { mounted() {
const ydoc = new Y.Doc() const ydoc = new Y.Doc()
const provider = new WebsocketProvider('wss://websocket.tiptap.dev', 'tiptap-draw-example', ydoc) this.provider = new WebsocketProvider('wss://websocket.tiptap.dev', 'tiptap-draw-example', ydoc)
this.editor = new Editor({ this.editor = new Editor({
extensions: [ extensions: [
@@ -44,6 +45,7 @@ export default {
beforeDestroy() { beforeDestroy() {
this.editor.destroy() this.editor.destroy()
this.provider.destroy()
}, },
} }
</script> </script>