docs: Fix menu example in doc (#2089)

This commit is contained in:
Phoenix Gao
2021-10-26 22:23:48 +08:00
committed by GitHub
parent 9d6a3ba1aa
commit 2fff9c264b

View File

@@ -35,7 +35,7 @@ Okay, youve got your menu. But how do you wire things up?
Youve got the editor running already and want to add your first button. You need a `<button>` HTML tag with a click handler. Depending on your setup, that can look like the following example: Youve got the editor running already and want to add your first button. You need a `<button>` HTML tag with a click handler. Depending on your setup, that can look like the following example:
```html ```html
<button onclick="editor.chain().toggleBold().focus().run()"> <button onclick="editor.chain().focus().toggleBold().run()">
Bold Bold
</button> </button>
``` ```
@@ -63,7 +63,7 @@ You have already seen the `focus()` command in the above example. When you click
The editor provides an `isActive()` method to check if something is applied to the selected text already. In Vue.js you can toggle a CSS class with help of that function like that: The editor provides an `isActive()` method to check if something is applied to the selected text already. In Vue.js you can toggle a CSS class with help of that function like that:
```html ```html
<button :class="{ 'is-active': editor.isActive('bold') }" @click="editor.chain().toggleBold().focus().run()"> <button :class="{ 'is-active': editor.isActive('bold') }" @click="editor.chain().focus().toggleBold().run()">
Bold Bold
</button> </button>
``` ```