add the text extension page
This commit is contained in:
5
docs/src/demos/Extensions/Text/index.spec.js
Normal file
5
docs/src/demos/Extensions/Text/index.spec.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
context('/api/extensions/document', () => {
|
||||||
|
before(() => {
|
||||||
|
cy.visit('/api/extensions/document')
|
||||||
|
})
|
||||||
|
})
|
||||||
42
docs/src/demos/Extensions/Text/index.vue
Normal file
42
docs/src/demos/Extensions/Text/index.vue
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<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'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
EditorContent,
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
editor: null,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.editor = new Editor({
|
||||||
|
extensions: [
|
||||||
|
Document(),
|
||||||
|
Paragraph(),
|
||||||
|
Text(),
|
||||||
|
],
|
||||||
|
content: `
|
||||||
|
<p>The Text extension is required, at least if you want to have text in your text editor and that’s very likely.</p>
|
||||||
|
`,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
beforeDestroy() {
|
||||||
|
this.editor.destroy()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,2 +1,12 @@
|
|||||||
# Text
|
# Text
|
||||||
Enables you to use text in the editor.
|
**The `Text` extension is required**, at least if you want to work with text of any kind and that’s very likely. This extension is a little bit different, it doesn’t even render HTML. It’s plain text, that’s all.
|
||||||
|
|
||||||
|
:::warning Breaking Change from 1.x → 2.x
|
||||||
|
Tiptap 1 tried to hide that node from you, but it has always been there.
|
||||||
|
:::
|
||||||
|
|
||||||
|
## Source Code
|
||||||
|
[packages/extension-text/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-text/)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
<demo name="Extensions/Text" highlight="12,30" />
|
||||||
@@ -172,7 +172,6 @@
|
|||||||
# draft: true
|
# draft: true
|
||||||
- title: Text
|
- title: Text
|
||||||
link: /api/extensions/text
|
link: /api/extensions/text
|
||||||
draft: true
|
|
||||||
# - title: TodoItem
|
# - title: TodoItem
|
||||||
# link: /api/extensions/todo-item
|
# link: /api/extensions/todo-item
|
||||||
# draft: true
|
# draft: true
|
||||||
|
|||||||
Reference in New Issue
Block a user