docs: update extension examples
This commit is contained in:
@@ -8,6 +8,7 @@ import Document from '@tiptap/extension-document'
|
||||
import Paragraph from '@tiptap/extension-paragraph'
|
||||
import Text from '@tiptap/extension-text'
|
||||
import Collaboration from '@tiptap/extension-collaboration'
|
||||
import Placeholder from '@tiptap/extension-placeholder'
|
||||
import * as Y from 'yjs'
|
||||
import { WebrtcProvider } from 'y-webrtc'
|
||||
|
||||
@@ -35,6 +36,9 @@ export default {
|
||||
Collaboration.configure({
|
||||
document: ydoc,
|
||||
}),
|
||||
Placeholder.configure({
|
||||
placeholder: 'Write something … It’ll be shared with everyone else looking at this example.',
|
||||
}),
|
||||
],
|
||||
})
|
||||
},
|
||||
@@ -45,3 +49,21 @@ export default {
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/* Basic editor styles */
|
||||
.ProseMirror {
|
||||
> * + * {
|
||||
margin-top: 0.75em;
|
||||
}
|
||||
}
|
||||
|
||||
/* Placeholder (at the top) */
|
||||
.ProseMirror p.is-editor-empty:first-child::before {
|
||||
content: attr(data-placeholder);
|
||||
float: left;
|
||||
color: #adb5bd;
|
||||
pointer-events: none;
|
||||
height: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user