add content to the extensions overview, improve the basic example

This commit is contained in:
Hans Pagel
2020-08-31 17:34:09 +02:00
parent 30483257d1
commit f8e907783d
8 changed files with 63 additions and 30 deletions

View File

@@ -2,13 +2,7 @@
<div>
<div v-if="editor">
<button @click="editor.focus().removeMarks()">
clear formatting
</button>
<button @click="editor.focus().undo()">
undo
</button>
<button @click="editor.focus().redo()">
redo
clear format
</button>
<button @click="editor.focus().bold()" :class="{ 'is-active': editor.isActive('bold') }">
bold
@@ -19,7 +13,7 @@
<button @click="editor.focus().code()" :class="{ 'is-active': editor.isActive('code') }">
code
</button>
<button @click="editor.focus().code_block()" :class="{ 'is-active': editor.isActive('code_block') }">
<button @click="editor.focus().codeBlock()" :class="{ 'is-active': editor.isActive('code_block') }">
code_block
</button>
<button @click="editor.focus().heading({ level: 1 })" :class="{ 'is-active': editor.isActive('heading', { level: 1 }) }">
@@ -40,6 +34,12 @@
<button @click="editor.focus().heading({ level: 6 })" :class="{ 'is-active': editor.isActive('heading', { level: 6 }) }">
h6
</button>
<button @click="editor.focus().undo()">
undo
</button>
<button @click="editor.focus().redo()">
redo
</button>
</div>
<editor-content :editor="editor" />
</div>
@@ -67,6 +67,8 @@ export default {
`,
extensions: defaultExtensions(),
})
window.editor = this.editor
},
beforeDestroy() {