demos: add tippy duration to all menu demos

This commit is contained in:
Philipp Kühn 2022-02-11 14:23:04 +01:00
parent 3462e56252
commit ab4a0e2507
4 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,7 @@ export default () => {
return (
<>
{editor && <BubbleMenu editor={editor}>
{editor && <BubbleMenu editor={editor} tippyOptions={{ duration: 100 }}>
<button
onClick={() => editor.chain().focus().toggleBold().run()}
className={editor.isActive('bold') ? 'is-active' : ''}

View File

@ -1,6 +1,6 @@
<template>
<div>
<bubble-menu :editor="editor" v-if="editor">
<bubble-menu :editor="editor" :tippy-options="{ duration: 100 }" v-if="editor">
<button @click="editor.chain().focus().toggleBold().run()" :class="{ 'is-active': editor.isActive('bold') }">
bold
</button>

View File

@ -18,7 +18,7 @@ export default () => {
return (
<>
{editor && <FloatingMenu editor={editor}>
{editor && <FloatingMenu editor={editor} tippyOptions={{ duration: 100 }}>
<button
onClick={() => editor.chain().focus().toggleHeading({ level: 1 }).run()}
className={editor.isActive('heading', { level: 1 }) ? 'is-active' : ''}

View File

@ -1,6 +1,6 @@
<template>
<div>
<floating-menu :editor="editor" v-if="editor">
<floating-menu :editor="editor" :tippy-options="{ duration: 100 }" v-if="editor">
<button @click="editor.chain().focus().toggleHeading({ level: 1 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 1 }) }">
H1
</button>