add new extensions to the basic example

This commit is contained in:
Hans Pagel
2020-09-10 14:51:07 +02:00
parent 6a7ce77121
commit 7c069e3eb6
2 changed files with 20 additions and 2 deletions

View File

@@ -10,6 +10,12 @@
<button @click="editor.focus().italic()" :class="{ 'is-active': editor.isActive('italic') }">
italic
</button>
<button @click="editor.focus().underline()" :class="{ 'is-active': editor.isActive('underline') }">
underline
</button>
<button @click="editor.focus().strike()" :class="{ 'is-active': editor.isActive('strike') }">
strike
</button>
<button @click="editor.focus().code()" :class="{ 'is-active': editor.isActive('code') }">
code
</button>
@@ -34,6 +40,15 @@
<button @click="editor.focus().heading({ level: 6 })" :class="{ 'is-active': editor.isActive('heading', { level: 6 }) }">
h6
</button>
<button @click="editor.focus().blockquote()" :class="{ 'is-active': editor.isActive('blockquote') }">
blockquote
</button>
<button @click="editor.focus().horizontalRule()">
horizontal rule
</button>
<button @click="editor.focus().hardBreak()">
hard break
</button>
<button @click="editor.focus().undo()">
undo
</button>
@@ -61,11 +76,11 @@ export default {
mounted() {
this.editor = new Editor({
extensions: defaultExtensions(),
content: `
<h2>Hey there!</h2>
<p>This editor is based on Prosemirror, fully extendable and renderless. You can easily add custom nodes as Vue components.</p>
`,
extensions: defaultExtensions(),
})
window.editor = this.editor