Text Editor - Strikethrough

Toggle strikethrough formatting on the current selection with the strikethrough command and pressed state.

#Usage

import { TextEditor } from '@primeui/vue-texteditor';
<TextEditor.Root v-model="value">
    <TextEditor.Toolbar>
        <StrikethroughButton />
    </TextEditor.Toolbar>
    <TextEditor.Content />
</TextEditor.Root>

Strikethrough marks text as removed or no longer valid. A toolbar button toggles the mark on the selection with commands.strikethrough() and reflects pressed state with state.strikethrough, both from useTextEditorContext().

#Command

commands.strikethrough() toggles the mark on the selected text.

<!-- StrikethroughButton.vue -->
<script setup lang="ts">
import { useTextEditorContext } from '@primeui/vue-texteditor';

const { commands, state } = useTextEditorContext();
</script>

<template>
    <button @click="commands.strikethrough()" :aria-pressed="state.strikethrough">S</button>
</template>

#Example

Loading Demo...

#API

commands.strikethrough() and state.strikethrough come from useTextEditorContext(). See API for the full reference.