add new command syntax to examples

This commit is contained in:
Philipp Kühn
2018-10-28 22:57:05 +01:00
parent 340b1b2266
commit e66218bd95
11 changed files with 74 additions and 72 deletions

View File

@@ -1,12 +1,12 @@
<template>
<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': nodes.paragraph.active({ textAlign: 'left' }) }"
@click="nodes.paragraph.command({ textAlign: 'left' })"
@click="commands.paragraph({ textAlign: 'left' })"
>
<icon name="align-left" />
</button>
@@ -14,7 +14,7 @@
<button
class="menubar__button"
:class="{ 'is-active': nodes.paragraph.active({ textAlign: 'center' }) }"
@click="nodes.paragraph.command({ textAlign: 'center' })"
@click="commands.paragraph({ textAlign: 'center' })"
>
<icon name="align-center" />
</button>
@@ -22,7 +22,7 @@
<button
class="menubar__button"
:class="{ 'is-active': nodes.paragraph.active({ textAlign: 'right' }) }"
@click="nodes.paragraph.command({ textAlign: 'right' })"
@click="commands.paragraph({ textAlign: 'right' })"
>
<icon name="align-right" />
</button>