mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-18 06:03:22 +08:00
remove Y.js form drawing demo
This commit is contained in:
parent
dbeb426aec
commit
12c7c22af2
@ -5,12 +5,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Collaboration from '@tiptap/extension-collaboration'
|
|
||||||
import { Editor, EditorContent } from '@tiptap/vue-starter-kit'
|
import { Editor, EditorContent } from '@tiptap/vue-starter-kit'
|
||||||
import Document from '@tiptap/extension-document'
|
import Document from '@tiptap/extension-document'
|
||||||
import Text from '@tiptap/extension-text'
|
import Text from '@tiptap/extension-text'
|
||||||
import * as Y from 'yjs'
|
|
||||||
import { WebsocketProvider } from 'y-websocket'
|
|
||||||
import Paper from './Paper.js'
|
import Paper from './Paper.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -26,17 +23,11 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
const ydoc = new Y.Doc()
|
|
||||||
this.provider = new WebsocketProvider('wss://websocket.tiptap.dev', 'tiptap-draw-example', ydoc)
|
|
||||||
|
|
||||||
this.editor = new Editor({
|
this.editor = new Editor({
|
||||||
extensions: [
|
extensions: [
|
||||||
Document.extend({
|
Document.extend({
|
||||||
content: 'paper',
|
content: 'paper',
|
||||||
}),
|
}),
|
||||||
Collaboration.configure({
|
|
||||||
document: ydoc,
|
|
||||||
}),
|
|
||||||
Text,
|
Text,
|
||||||
Paper,
|
Paper,
|
||||||
],
|
],
|
||||||
@ -45,7 +36,6 @@ export default {
|
|||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.editor.destroy()
|
this.editor.destroy()
|
||||||
this.provider.destroy()
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -2,12 +2,4 @@
|
|||||||
|
|
||||||
Did you ever wanted to draw in a text editor? Me neither. Anyway, here is an example how that could work with tiptap. If you want to build something like that, [learn more about node views](/guide/node-views).
|
Did you ever wanted to draw in a text editor? Me neither. Anyway, here is an example how that could work with tiptap. If you want to build something like that, [learn more about node views](/guide/node-views).
|
||||||
|
|
||||||
:::warning Shared Document
|
|
||||||
Be nice! The content of this editor is shared with other users from the Internet.
|
|
||||||
:::
|
|
||||||
|
|
||||||
<demo name="Examples/Drawing" :show-source="false" />
|
|
||||||
|
|
||||||
Here is another instance of that demo, to illustrate how changes can be synced. Be nice, those changes are synced to all users on this page. Open another tab to test that out!
|
|
||||||
|
|
||||||
<demo name="Examples/Drawing" />
|
<demo name="Examples/Drawing" />
|
||||||
|
Loading…
Reference in New Issue
Block a user