add basic mention extension
This commit is contained in:
5
docs/src/demos/Nodes/Mention/index.spec.js
Normal file
5
docs/src/demos/Nodes/Mention/index.spec.js
Normal file
@@ -0,0 +1,5 @@
|
||||
context('/api/nodes/mention', () => {
|
||||
before(() => {
|
||||
cy.visit('/api/nodes/mention')
|
||||
})
|
||||
})
|
||||
44
docs/src/demos/Nodes/Mention/index.vue
Normal file
44
docs/src/demos/Nodes/Mention/index.vue
Normal 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>
|
||||
Reference in New Issue
Block a user