tiptap/examples/Components/Routes/Collaboration2/Collab.js

25 lines
448 B
JavaScript
Raw Normal View History

2019-02-05 09:20:49 +08:00
import { Extension } from 'tiptap'
import { collab } from 'prosemirror-collab'
export default class CollabExtension extends Extension {
get name() {
return 'collab'
}
get defaultOptions() {
return {
version: 0,
clientID: Math.floor(Math.random() * 0xFFFFFFFF),
}
}
get plugins() {
return [
collab({
version: this.options.version,
clientID: this.options.clientID,
}),
]
}
}