improve basic example, add task
This commit is contained in:
@@ -1,9 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
BUG: Headings can’t be transformed to a bullet or ordered list.
|
||||||
<div v-if="editor">
|
<div v-if="editor">
|
||||||
<button @click="editor.chain().focus().removeMarks().run()">
|
|
||||||
clear format
|
|
||||||
</button>
|
|
||||||
<button @click="editor.chain().focus().bold().run()" :class="{ 'is-active': editor.isActive('bold') }">
|
<button @click="editor.chain().focus().bold().run()" :class="{ 'is-active': editor.isActive('bold') }">
|
||||||
bold
|
bold
|
||||||
</button>
|
</button>
|
||||||
@@ -19,14 +17,8 @@
|
|||||||
<button @click="editor.chain().focus().code().run()" :class="{ 'is-active': editor.isActive('code') }">
|
<button @click="editor.chain().focus().code().run()" :class="{ 'is-active': editor.isActive('code') }">
|
||||||
code
|
code
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().bulletList().run()" :class="{ 'is-active': editor.isActive('bullet_list') }">
|
<button @click="editor.chain().focus().removeMarks().run()">
|
||||||
bullet list
|
clear format
|
||||||
</button>
|
|
||||||
<button @click="editor.chain().focus().orderedList().run()" :class="{ 'is-active': editor.isActive('ordered_list') }">
|
|
||||||
ordered list
|
|
||||||
</button>
|
|
||||||
<button @click="editor.chain().focus().codeBlock().run()" :class="{ 'is-active': editor.isActive('codeBlock') }">
|
|
||||||
code block
|
|
||||||
</button>
|
</button>
|
||||||
<button @click="editor.chain().focus().paragraph().run()" :class="{ 'is-active': editor.isActive('paragraph') }">
|
<button @click="editor.chain().focus().paragraph().run()" :class="{ 'is-active': editor.isActive('paragraph') }">
|
||||||
paragraph
|
paragraph
|
||||||
@@ -49,6 +41,15 @@
|
|||||||
<button @click="editor.chain().focus().heading({ level: 6 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 6 }) }">
|
<button @click="editor.chain().focus().heading({ level: 6 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 6 }) }">
|
||||||
h6
|
h6
|
||||||
</button>
|
</button>
|
||||||
|
<button @click="editor.chain().focus().bulletList().run()" :class="{ 'is-active': editor.isActive('bullet_list') }">
|
||||||
|
bullet list
|
||||||
|
</button>
|
||||||
|
<button @click="editor.chain().focus().orderedList().run()" :class="{ 'is-active': editor.isActive('ordered_list') }">
|
||||||
|
ordered list
|
||||||
|
</button>
|
||||||
|
<button @click="editor.chain().focus().codeBlock().run()" :class="{ 'is-active': editor.isActive('codeBlock') }">
|
||||||
|
code block
|
||||||
|
</button>
|
||||||
<button @click="editor.chain().focus().blockquote().run()" :class="{ 'is-active': editor.isActive('blockquote') }">
|
<button @click="editor.chain().focus().blockquote().run()" :class="{ 'is-active': editor.isActive('blockquote') }">
|
||||||
blockquote
|
blockquote
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user