add basic mention extension

This commit is contained in:
Philipp Kühn
2020-12-17 17:13:35 +01:00
committed by Hans Pagel
parent 72b4eb17bd
commit eb695878a0
12 changed files with 173 additions and 17 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>

View File

@@ -1,7 +1,16 @@
# Mention
:::pro Fund the development 💖
We need your support to maintain, update, support and develop tiptap 2. If youre waiting for this extension, [become a sponsor and fund open source](/sponsor).
:::
## Installation
```bash
# with npm
npm install @tiptap/extension-mention
TODO
# with Yarn
yarn add @tiptap/extension-mention
```
## Source code
[packages/extension-mention/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-mention/)
## Usage
<demo name="Nodes/Mention" />