add insertHTML command

This commit is contained in:
Philipp Kühn
2019-12-14 23:54:20 +01:00
parent 90f86bafbb
commit 6f1aedb2b2
4 changed files with 55 additions and 14 deletions

View File

@@ -2,6 +2,8 @@
<Layout>
<h1>{{ $page.post.title }}</h1>
<VueRemarkContent />
<div ref="editor"></div>
</Layout>
</template>
@@ -20,16 +22,29 @@ export default {
mounted() {
// console.log(tiptap())
// new Editor()
// .registerCommand('lol', (next) => {
// console.log('lol')
// next()
// })
// .focus('end')
// .insertText('mega ')
// .focus('start')
// .command('insertText', 'giga ')
// .lol()
new Editor({
element: this.$refs.editor,
content: '<p>test <strong>strong</strong></p>',
})
// .registerCommand('lol', (next) => {
// console.log('lol')
// next()
// })
// .focus('end')
// .insertText('mega ')
// .focus('start')
// .command('insertText', 'giga ')
// .lol()
// .registerCommand('insertHTML', (next, editor, html) => {
// console.log(html)
// next()
// })
.focus('start')
.insertText('<p>start</p>')
.focus('end')
.insertHTML('<p>end</p>')
}
}
</script>