Skip to content

Commit

Permalink
feat: ✨ add paragraph dropdown-item in heading dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Leecason committed Jan 4, 2020
1 parent 26109cb commit 3996f60
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/MenuCommands/HeadingDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,25 @@
<el-dropdown
placement="bottom"
trigger="hover"
@command="i => editorContext.commands.heading({ level: i })"
@command="i => i > 0
? editorContext.commands.heading({ level: i })
: editorContext.commands.paragraph
"
>
<command-button
:is-active="isHeadingActive(undefined)"
tooltip="Heading"
icon="heading"
/>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
:command="0"
:class="{
'el-dropdown-menu__item--active': editorContext.isActive.paragraph(),
}"
>
<span>Paragraph</span>
</el-dropdown-item>
<el-dropdown-item
v-for="i in level"
:key="i"
Expand Down

0 comments on commit 3996f60

Please sign in to comment.