add paragraph command
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
<button @click="editor.chain().focus().clearNodes().run()">
|
<button @click="editor.chain().focus().clearNodes().run()">
|
||||||
clear nodes
|
clear nodes
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().paragraph().run()" :class="{ 'is-active': editor.isActive('paragraph') }">
|
<button @click="editor.chain().focus().setParagraph().run()" :class="{ 'is-active': editor.isActive('paragraph') }">
|
||||||
paragraph
|
paragraph
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().toggleHeading({ level: 1 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 1 }) }">
|
<button @click="editor.chain().focus().toggleHeading({ level: 1 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 1 }) }">
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<button @click="editor.chain().focus().clearNodes().run()">
|
<button @click="editor.chain().focus().clearNodes().run()">
|
||||||
clear nodes
|
clear nodes
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().paragraph().run()" :class="{ 'is-active': editor.isActive('paragraph') }">
|
<button @click="editor.chain().focus().setParagraph().run()" :class="{ 'is-active': editor.isActive('paragraph') }">
|
||||||
paragraph
|
paragraph
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().toggleHeading({ level: 1 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 1 }) }">
|
<button @click="editor.chain().focus().toggleHeading({ level: 1 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 1 }) }">
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<button @click="editor.chain().focus().clearNodes().run()">
|
<button @click="editor.chain().focus().clearNodes().run()">
|
||||||
clear nodes
|
clear nodes
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().paragraph().run()" :class="{ 'is-active': editor.isActive('paragraph') }">
|
<button @click="editor.chain().focus().setParagraph().run()" :class="{ 'is-active': editor.isActive('paragraph') }">
|
||||||
paragraph
|
paragraph
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().toggleHeading({ level: 1 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 1 }) }">
|
<button @click="editor.chain().focus().toggleHeading({ level: 1 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 1 }) }">
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<button @click="editor.chain().focus().toggleHeading({ level: 3 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 3 }) }">
|
<button @click="editor.chain().focus().toggleHeading({ level: 3 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 3 }) }">
|
||||||
h3
|
h3
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().paragraph().run()" :class="{ 'is-active': editor.isActive('paragraph') }">
|
<button @click="editor.chain().focus().setParagraph().run()" :class="{ 'is-active': editor.isActive('paragraph') }">
|
||||||
paragraph
|
paragraph
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().textAlign('left').run()">
|
<button @click="editor.chain().focus().textAlign('left').run()">
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ const Paragraph = Node.create({
|
|||||||
/**
|
/**
|
||||||
* Toggle a paragraph
|
* Toggle a paragraph
|
||||||
*/
|
*/
|
||||||
paragraph: (): Command => ({ commands }) => {
|
setParagraph: (): Command => ({ commands }) => {
|
||||||
return commands.toggleBlockType('paragraph', 'paragraph')
|
return commands.toggleBlockType('paragraph', 'paragraph')
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ const Paragraph = Node.create({
|
|||||||
|
|
||||||
addKeyboardShortcuts() {
|
addKeyboardShortcuts() {
|
||||||
return {
|
return {
|
||||||
'Mod-Alt-0': () => this.editor.commands.paragraph(),
|
'Mod-Alt-0': () => this.editor.commands.setParagraph(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user