add bold button

This commit is contained in:
Philipp Kühn
2020-03-30 12:43:41 +02:00
parent fd476901c4
commit fc5fe7a8ba
2 changed files with 5 additions and 2 deletions

View File

@@ -6,8 +6,8 @@ export default class Bold extends Mark {
name = 'bold'
created() {
this.editor.registerCommand('bold', next => {
toggleMark(this.schemaType)
this.editor.registerCommand('bold', (next, { view }) => {
toggleMark(this.schemaType)(view.state, view.dispatch)
next()
})
}

View File

@@ -7,6 +7,9 @@
<button @click="editor.redo().focus()">
redo
</button>
<button @click="editor.bold().focus()">
bold
</button>
</div>
<editor-content :editor="editor" />
</div>