mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-16 11:49:02 +08:00
67 lines
1.1 KiB
Vue
67 lines
1.1 KiB
Vue
|
<template>
|
||
|
<div>
|
||
|
<editor class="editor" :extensions="extensions">
|
||
|
|
||
|
<div class="editor__content" slot="content" slot-scope="props">
|
||
|
<h2>
|
||
|
Images
|
||
|
</h2>
|
||
|
<p>
|
||
|
Nice
|
||
|
</p>
|
||
|
<img src="https://tiptap.scrumpy.io/assets/images/open-graph.png" />
|
||
|
</div>
|
||
|
|
||
|
</editor>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
import Icon from 'Components/Icon'
|
||
|
import { Editor } from 'tiptap'
|
||
|
import {
|
||
|
BlockquoteNode,
|
||
|
BulletListNode,
|
||
|
CodeBlockNode,
|
||
|
HardBreakNode,
|
||
|
HeadingNode,
|
||
|
ImageNode,
|
||
|
ListItemNode,
|
||
|
OrderedListNode,
|
||
|
TodoItemNode,
|
||
|
TodoListNode,
|
||
|
BoldMark,
|
||
|
CodeMark,
|
||
|
ItalicMark,
|
||
|
LinkMark,
|
||
|
HistoryExtension,
|
||
|
} from 'tiptap-extensions'
|
||
|
|
||
|
export default {
|
||
|
components: {
|
||
|
Editor,
|
||
|
Icon,
|
||
|
},
|
||
|
data() {
|
||
|
return {
|
||
|
extensions: [
|
||
|
new BlockquoteNode(),
|
||
|
new BulletListNode(),
|
||
|
new CodeBlockNode(),
|
||
|
new HardBreakNode(),
|
||
|
new HeadingNode({ maxLevel: 3 }),
|
||
|
new ImageNode(),
|
||
|
new ListItemNode(),
|
||
|
new OrderedListNode(),
|
||
|
new TodoItemNode(),
|
||
|
new TodoListNode(),
|
||
|
new BoldMark(),
|
||
|
new CodeMark(),
|
||
|
new ItalicMark(),
|
||
|
new LinkMark(),
|
||
|
new HistoryExtension(),
|
||
|
],
|
||
|
}
|
||
|
},
|
||
|
}
|
||
|
</script>
|