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' name = 'bold'
created() { created() {
this.editor.registerCommand('bold', next => { this.editor.registerCommand('bold', (next, { view }) => {
toggleMark(this.schemaType) toggleMark(this.schemaType)(view.state, view.dispatch)
next() next()
}) })
} }

View File

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