mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-14 02:09:01 +08:00
1.2 KiB
1.2 KiB
Strike
Allows you to use the <s>
HTML tag in the editor.
Options
None
Commands
command | options | description |
---|---|---|
strike | none | Mark text as strikethrough. |
Keybindings
- Windows & Linux:
Control
+D
- macOS:
Command
+D
Example
<template>
<div>
<editor-menu-bar :editor="editor" v-slot="{ commands, isActive }">
<button type="button" :class="{ 'is-active': isActive.strike() }" @click="commands.strike">
Strike
</button>
</editor-menu-bar>
<editor-content :editor="editor" />
</div>
</template>
<script>
import { Editor, EditorContent, EditorMenuBar } from 'tiptap'
import { Strike } from 'tiptap-extensions'
export default {
components: {
EditorMenuBar,
EditorContent,
},
data() {
return {
editor: new Editor({
extensions: [
new Strike(),
],
content: `
<p><s>That's strikethrough.</s></p>
<p><del>This too.</del></p>
<p><strike>And this.</strike></p>
<p style="text-decoration: line-through">This as well.</p>
`,
}),
}
},
beforeDestroy() {
this.editor.destroy()
}
}
</script>