mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-15 11:09:01 +08:00
1.5 KiB
1.5 KiB
Blockquote
The Blockquote extension enables you to use the <blockquote>
HTML tag in the editor.
Options
Option | Type | Default | Description |
---|---|---|---|
class | string | – | Add a custom class to the rendered HTML tag. |
Commands
Command | Options | Description |
---|---|---|
blockquote | — | Wrap content in a blockquote. |
Keyboard shortcuts
Control
+→
Usage
<template>
<div>
<editor-menu-bar :editor="editor" v-slot="{ commands, isActive }">
<button type="button" :class="{ 'is-active': isActive.blockquote() }" @click="commands.blockquote">
Blockquote
</button>
</editor-menu-bar>
<editor-content :editor="editor" />
</div>
</template>
<script>
import { Editor, EditorContent, EditorMenuBar } from 'tiptap'
import { Blockquote } from 'tiptap-extensions'
export default {
components: {
EditorMenuBar,
EditorContent,
},
data() {
return {
editor: new Editor({
extensions: [
Blockquote(),
],
content: `
<blockquote>
Life is like riding a bycicle. To keep your balance, you must keep moving.
</blockquote>
<p>Albert Einstein</p>
`,
}),
}
},
beforeDestroy() {
this.editor.destroy()
}
}
</script>