make less assumptions about the Y.js provider, fix #70
This commit is contained in:
@@ -19,12 +19,13 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
editor: null,
|
||||
provider: null,
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
const ydoc = new Y.Doc()
|
||||
const provider = new WebrtcProvider('tiptap-collaboration-extension', ydoc)
|
||||
this.provider = new WebrtcProvider('tiptap-collaboration-extension', ydoc)
|
||||
|
||||
this.editor = new Editor({
|
||||
extensions: [
|
||||
@@ -32,7 +33,7 @@ export default {
|
||||
Paragraph,
|
||||
Text,
|
||||
Collaboration.configure({
|
||||
provider,
|
||||
document: ydoc,
|
||||
}),
|
||||
],
|
||||
})
|
||||
@@ -40,6 +41,7 @@ export default {
|
||||
|
||||
beforeDestroy() {
|
||||
this.editor.destroy()
|
||||
this.provider.destroy()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user