add first test

This commit is contained in:
Philipp Kühn
2020-03-03 23:34:03 +01:00
parent 4297260cf7
commit ddad1a62e6
22 changed files with 72 additions and 1999 deletions

53
src/pages/tests/Basic.vue Normal file
View File

@@ -0,0 +1,53 @@
<template>
<Layout>
<div ref="editor"></div>
</Layout>
</template>
<script>
import Editor from '@tiptap/core'
export default {
mounted() {
window.editor = new Editor({
element: this.$refs.editor,
content: '<p>foo</p>',
})
// .focus('end')
// .insertText('foo')
// .insertHTML('<p>hey</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()
// })
// .registerCommand('insertHello', async (next, editor) => {
// await editor.insertHTML('<strong>HELLO</strong>')
// next()
// })
// .registerCommand('insertHello', (next, editor) => {
// editor
// .focus('start')
// .insertHTML('<strong>HELLO</strong>')
// next()
// })
// .focus('start')
// .insertHello()
// .insertText('eins')
// .insertText('zwei')
// .insertText('drei')
// .insertHello()
// .focus('end')
// .insertHTML('<p>end</p>')
}
}
</script>