add insertHTML command
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user