add hardbreak commands
This commit is contained in:
@@ -55,7 +55,7 @@
|
|||||||
<button @click="editor.chain().focus().horizontalRule().run()">
|
<button @click="editor.chain().focus().horizontalRule().run()">
|
||||||
horizontal rule
|
horizontal rule
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().hardBreak().run()">
|
<button @click="editor.chain().focus().setHardBreak().run()">
|
||||||
hard break
|
hard break
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().undo().run()">
|
<button @click="editor.chain().focus().undo().run()">
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
<button @click="editor.chain().focus().horizontalRule().run()">
|
<button @click="editor.chain().focus().horizontalRule().run()">
|
||||||
horizontal rule
|
horizontal rule
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().hardBreak().run()">
|
<button @click="editor.chain().focus().setHardBreak().run()">
|
||||||
hard break
|
hard break
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().undo().run()">
|
<button @click="editor.chain().focus().undo().run()">
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
<button @click="editor.chain().focus().horizontalRule().run()">
|
<button @click="editor.chain().focus().horizontalRule().run()">
|
||||||
horizontal rule
|
horizontal rule
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().hardBreak().run()">
|
<button @click="editor.chain().focus().setHardBreak().run()">
|
||||||
hard break
|
hard break
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().undo().run()">
|
<button @click="editor.chain().focus().undo().run()">
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="editor">
|
<div v-if="editor">
|
||||||
<button @click="editor.chain().focus().hardBreak().run()">
|
<button @click="editor.chain().focus().setHardBreak().run()">
|
||||||
hardBreak
|
hardBreak
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const HardBreak = Node.create({
|
|||||||
/**
|
/**
|
||||||
* Add a hard break
|
* Add a hard break
|
||||||
*/
|
*/
|
||||||
hardBreak: (): Command => ({ commands, state, dispatch }) => {
|
setHardBreak: (): Command => ({ commands, state, dispatch }) => {
|
||||||
return commands.try([
|
return commands.try([
|
||||||
() => exitCode(state, dispatch),
|
() => exitCode(state, dispatch),
|
||||||
() => {
|
() => {
|
||||||
@@ -42,8 +42,8 @@ const HardBreak = Node.create({
|
|||||||
|
|
||||||
addKeyboardShortcuts() {
|
addKeyboardShortcuts() {
|
||||||
return {
|
return {
|
||||||
'Mod-Enter': () => this.editor.commands.hardBreak(),
|
'Mod-Enter': () => this.editor.commands.setHardBreak(),
|
||||||
'Shift-Enter': () => this.editor.commands.hardBreak(),
|
'Shift-Enter': () => this.editor.commands.setHardBreak(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user