add basic mention extension

This commit is contained in:
Philipp Kühn
2020-12-17 17:13:35 +01:00
parent c3d0f004d6
commit 5a9b96aaf0
13 changed files with 179 additions and 13 deletions

View File

@@ -0,0 +1,5 @@
context('/api/nodes/mention', () => {
before(() => {
cy.visit('/api/nodes/mention')
})
})

View File

@@ -0,0 +1,44 @@
<template>
<div v-if="editor">
<editor-content :editor="editor" />
</div>
</template>
<script>
import { Editor } from '@tiptap/core'
import { EditorContent } from '@tiptap/vue'
import Document from '@tiptap/extension-document'
import Paragraph from '@tiptap/extension-paragraph'
import Text from '@tiptap/extension-text'
import Mention from '@tiptap/extension-mention'
export default {
components: {
EditorContent,
},
data() {
return {
editor: null,
}
},
mounted() {
this.editor = new Editor({
extensions: [
Document,
Paragraph,
Text,
Mention,
],
content: `
<p>text <span data-mention></span></p>
`,
})
},
beforeDestroy() {
this.editor.destroy()
},
}
</script>