add new command syntax to examples
This commit is contained in:
@@ -2,12 +2,12 @@
|
||||
<div>
|
||||
<div class="editor">
|
||||
<menu-bar class="menubar" :editor="editor">
|
||||
<template slot-scope="{ nodes, marks }">
|
||||
<template slot-scope="{ nodes, marks, commands }">
|
||||
|
||||
<button
|
||||
class="menubar__button"
|
||||
:class="{ 'is-active': marks.bold.active() }"
|
||||
@click="marks.bold.command"
|
||||
@click="commands.bold"
|
||||
>
|
||||
<icon name="bold" />
|
||||
</button>
|
||||
@@ -15,23 +15,23 @@
|
||||
<button
|
||||
class="menubar__button"
|
||||
:class="{ 'is-active': marks.italic.active() }"
|
||||
@click="marks.italic.command"
|
||||
@click="commands.italic"
|
||||
>
|
||||
<icon name="italic" />
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="menubar__button"
|
||||
@click="marks.code.command"
|
||||
:class="{ 'is-active': marks.code.active() }
|
||||
">
|
||||
:class="{ 'is-active': marks.code.active() }"
|
||||
@click="commands.code"
|
||||
>
|
||||
<icon name="code" />
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="menubar__button"
|
||||
:class="{ 'is-active': nodes.paragraph.active() }"
|
||||
@click="nodes.paragraph.command"
|
||||
@click="commands.paragraph"
|
||||
>
|
||||
<icon name="paragraph" />
|
||||
</button>
|
||||
@@ -39,7 +39,7 @@
|
||||
<button
|
||||
class="menubar__button"
|
||||
:class="{ 'is-active': nodes.heading.active({ level: 1 }) }"
|
||||
@click="nodes.heading.command({ level: 1 })"
|
||||
@click="commands.heading({ level: 1 })"
|
||||
>
|
||||
H1
|
||||
</button>
|
||||
@@ -47,7 +47,7 @@
|
||||
<button
|
||||
class="menubar__button"
|
||||
:class="{ 'is-active': nodes.heading.active({ level: 2 }) }"
|
||||
@click="nodes.heading.command({ level: 2 })"
|
||||
@click="commands.heading({ level: 2 })"
|
||||
>
|
||||
H2
|
||||
</button>
|
||||
@@ -55,7 +55,7 @@
|
||||
<button
|
||||
class="menubar__button"
|
||||
:class="{ 'is-active': nodes.heading.active({ level: 3 }) }"
|
||||
@click="nodes.heading.command({ level: 3 })"
|
||||
@click="commands.heading({ level: 3 })"
|
||||
>
|
||||
H3
|
||||
</button>
|
||||
@@ -63,7 +63,7 @@
|
||||
<button
|
||||
class="menubar__button"
|
||||
:class="{ 'is-active': nodes.bullet_list.active() }"
|
||||
@click="nodes.bullet_list.command"
|
||||
@click="commands.bullet_list"
|
||||
>
|
||||
<icon name="ul" />
|
||||
</button>
|
||||
@@ -71,7 +71,7 @@
|
||||
<button
|
||||
class="menubar__button"
|
||||
:class="{ 'is-active': nodes.ordered_list.active() }"
|
||||
@click="nodes.ordered_list.command"
|
||||
@click="commands.ordered_list"
|
||||
>
|
||||
<icon name="ol" />
|
||||
</button>
|
||||
@@ -79,7 +79,7 @@
|
||||
<button
|
||||
class="menubar__button"
|
||||
:class="{ 'is-active': nodes.code_block.active() }"
|
||||
@click="nodes.code_block.command"
|
||||
@click="commands.code_block"
|
||||
>
|
||||
<icon name="code" />
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user