rename bulletlist command
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
<button @click="editor.chain().focus().heading({ level: 6 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 6 }) }">
|
||||
h6
|
||||
</button>
|
||||
<button @click="editor.chain().focus().bulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
<button @click="editor.chain().focus().toggleBulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
bullet list
|
||||
</button>
|
||||
<button @click="editor.chain().focus().orderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }">
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<button @click="editor.chain().focus().heading({ level: 6 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 6 }) }">
|
||||
h6
|
||||
</button>
|
||||
<button @click="editor.chain().focus().bulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
<button @click="editor.chain().focus().toggleBulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
bullet list
|
||||
</button>
|
||||
<button @click="editor.chain().focus().orderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }">
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<button @click="editor.chain().focus().heading({ level: 6 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 6 }) }">
|
||||
h6
|
||||
</button>
|
||||
<button @click="editor.chain().focus().bulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
<button @click="editor.chain().focus().toggleBulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
bullet list
|
||||
</button>
|
||||
<button @click="editor.chain().focus().orderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div v-if="editor">
|
||||
<button @click="editor.chain().focus().bulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
<button @click="editor.chain().focus().toggleBulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
bullet list
|
||||
</button>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div v-if="editor">
|
||||
<button @click="editor.chain().focus().bulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
<button @click="editor.chain().focus().toggleBulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }">
|
||||
bullet list
|
||||
</button>
|
||||
<button @click="editor.chain().focus().orderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }">
|
||||
|
||||
@@ -104,7 +104,7 @@ const CustomBulletList = BulletList.extend({
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
// ↓ your new keyboard shortcut
|
||||
'Mod-l': () => this.editor.commands.bulletList(),
|
||||
'Mod-l': () => this.editor.commands.toggleBulletList(),
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -25,7 +25,7 @@ import BulletList from '@tiptap/extension-bullet-list'
|
||||
const CustomBulletList = BulletList.extend({
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
'Mod-l': () => this.editor.commands.bulletList(),
|
||||
'Mod-l': () => this.editor.commands.toggleBulletList(),
|
||||
}
|
||||
},
|
||||
})
|
||||
@@ -296,7 +296,7 @@ import BulletList from '@tiptap/extension-bullet-list'
|
||||
const CustomBulletList = BulletList.extend({
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
'Mod-l': () => this.editor.commands.bulletList(),
|
||||
'Mod-l': () => this.editor.commands.toggleBulletList(),
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -35,7 +35,7 @@ const BulletList = Node.create({
|
||||
/**
|
||||
* Toggle a bullet list
|
||||
*/
|
||||
bulletList: (): Command => ({ commands }) => {
|
||||
toggleBulletList: (): Command => ({ commands }) => {
|
||||
return commands.toggleList('bulletList', 'listItem')
|
||||
},
|
||||
}
|
||||
@@ -43,7 +43,7 @@ const BulletList = Node.create({
|
||||
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
'Shift-Control-8': () => this.editor.commands.bulletList(),
|
||||
'Shift-Control-8': () => this.editor.commands.toggleBulletList(),
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user