mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-28 23:59:25 +08:00
add the text extension page
This commit is contained in:
parent
f8487c95a7
commit
2f9ee7fbbd
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
|
||||
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
|
||||
- title: Text
|
||||
link: /api/extensions/text
|
||||
draft: true
|
||||
# - title: TodoItem
|
||||
# link: /api/extensions/todo-item
|
||||
# draft: true
|
||||
|
Loading…
Reference in New Issue
Block a user