Merge branch 'master' of https://github.com/heyscrumpy/tiptap
This commit is contained in:
66
README.md
66
README.md
@@ -12,13 +12,13 @@ A rich-text editor for Vue.js
|
|||||||
npm install tiptap
|
npm install tiptap
|
||||||
```
|
```
|
||||||
|
|
||||||
## Setup
|
## Basic Setup
|
||||||
```vue
|
```vue
|
||||||
<template>
|
<template>
|
||||||
<editor>
|
<editor>
|
||||||
<!-- Add HTML to the scoped slot called "content" -->
|
<!-- Add HTML to the scoped slot called "content" -->
|
||||||
<div slot="content" slot-scope="props">
|
<div slot="content" slot-scope="props">
|
||||||
<p>Hello world</p>
|
<p>Hi, I'm just a boring paragraph</p>
|
||||||
</div>
|
</div>
|
||||||
</editor>
|
</editor>
|
||||||
</template>
|
</template>
|
||||||
@@ -46,6 +46,68 @@ export default {
|
|||||||
|
|
||||||
## Extensions
|
## Extensions
|
||||||
|
|
||||||
|
By default the editor will only support some boring paragraphs. Other nodes and marks are available as **extensions**. There is a package called `tiptap-extensions` with the most basic nodes, marks and plugins.
|
||||||
|
|
||||||
|
#### Available Extensions
|
||||||
|
|
||||||
|
```vue
|
||||||
|
<template>
|
||||||
|
<editor :extensions="extensions">
|
||||||
|
<div slot="content" slot-scope="props">
|
||||||
|
<h1>Yay Headlines!</h1>
|
||||||
|
<p>All these <strong>cool tags</strong> are working now.</p>
|
||||||
|
</div>
|
||||||
|
</editor>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Import the editor
|
||||||
|
import { Editor } from 'tiptap'
|
||||||
|
import {
|
||||||
|
Blockquote,
|
||||||
|
BulletList,
|
||||||
|
CodeBlock,
|
||||||
|
HardBreak,
|
||||||
|
Heading,
|
||||||
|
ListItem,
|
||||||
|
OrderedList,
|
||||||
|
TodoItem,
|
||||||
|
TodoList,
|
||||||
|
Bold,
|
||||||
|
Code,
|
||||||
|
Italic,
|
||||||
|
Link,
|
||||||
|
} from 'tiptap-extensions'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
Editor,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
extensions: [
|
||||||
|
new Blockquote(),
|
||||||
|
new BulletList(),
|
||||||
|
new CodeBlock(),
|
||||||
|
new HardBreak(),
|
||||||
|
new Heading(),
|
||||||
|
new ListItem(),
|
||||||
|
new OrderedList(),
|
||||||
|
new TodoItem(),
|
||||||
|
new TodoList(),
|
||||||
|
new Bold(),
|
||||||
|
new Code(),
|
||||||
|
new Italic(),
|
||||||
|
new Link(),
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Create Custom Extensions
|
||||||
|
|
||||||
Soon …
|
Soon …
|
||||||
Until then you can take a look at the [embed example](https://github.com/heyscrumpy/tiptap/tree/master/examples/Components/Routes/Embeds).
|
Until then you can take a look at the [embed example](https://github.com/heyscrumpy/tiptap/tree/master/examples/Components/Routes/Embeds).
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user