2018-09-01 02:42:13 +08:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<editor class="editor" :extensions="extensions">
|
|
|
|
|
|
|
|
<div class="editor__content" slot="content" slot-scope="props">
|
|
|
|
<h2>
|
|
|
|
Images
|
|
|
|
</h2>
|
|
|
|
<p>
|
2018-09-01 04:18:09 +08:00
|
|
|
This is basic example of implementing images. Try to drop new images here. Reordering also works.
|
2018-09-01 02:42:13 +08:00
|
|
|
</p>
|
2018-09-01 04:18:09 +08:00
|
|
|
<img src="https://ljdchost.com/8I2DeFn.gif" />
|
2018-09-01 02:42:13 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</editor>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { Editor } from 'tiptap'
|
|
|
|
import {
|
|
|
|
HardBreakNode,
|
|
|
|
HeadingNode,
|
|
|
|
ImageNode,
|
|
|
|
BoldMark,
|
|
|
|
CodeMark,
|
|
|
|
ItalicMark,
|
|
|
|
} from 'tiptap-extensions'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
Editor,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
extensions: [
|
|
|
|
new HardBreakNode(),
|
|
|
|
new HeadingNode({ maxLevel: 3 }),
|
|
|
|
new ImageNode(),
|
|
|
|
new BoldMark(),
|
|
|
|
new CodeMark(),
|
|
|
|
new ItalicMark(),
|
|
|
|
],
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|