add keyboardShortcut and enter command

This commit is contained in:
Philipp Kühn
2021-02-09 21:04:33 +01:00
parent e8232dd737
commit 2315357125
5 changed files with 102 additions and 46 deletions

View File

@@ -1,21 +1,6 @@
<template>
<div>
<div v-if="editor">
<button
@click="editor
.can()
.chain()
.focus()
.enter()
.insertText('1')
.enter()
.insertText('2')
.enter()
.insertText('3')
.run()"
>
enter
</button>
<button @click="editor.chain().focus().toggleBold().run()" :class="{ 'is-active': editor.isActive('bold') }">
bold
</button>

View File

@@ -177,7 +177,9 @@ Have a look at all of the core commands listed below. They should give you a goo
| .blur() | Removes focus from the editor. |
| .deleteRange() | Delete a given range. |
| .deleteSelection() | Delete the selection, if there is one. |
| .enter() | Trigger enter. |
| .focus() | Focus the editor at the given position. |
| .keyboardShortcut() | Trigger a keyboard shortcut. |
| .scrollIntoView() | Scroll the selection into view. |
| .selectAll() | Select the whole document. |
| .selectNodeBackward() | Select a node backward. |