@empathyco/x-components
Version:
Empathy X Components
64 lines (46 loc) • 1.73 kB
Markdown
---
title: SpellcheckButton
---
A button that when pressed emits the XEventsTypes.UserAcceptedAQuery
and XEventsTypes.UserAcceptedSpellcheckQuery events, expressing the user
intention to set the spellchecked query.
| Name | Description | Bindings<br />(name - type - description) |
| -------------------- | ----------- | ----------------------------------------- |
| <code>default</code> | | |
This component emits 2 different events:
- [`UserAcceptedAQuery`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):
the event is emitted after the user clicks the button. The event payload is the spellchecked query
data.
- [`UserAcceptedSpellcheckQuery`](https://github.com/empathyco/x/blob/main/packages/x-components/src/wiring/events.types.ts):
the event is emitted after the user clicks the button. The event payload is the spellchecked query
data.
The component sets the current spellcheckedQuery as the new query and emits the `UserAcceptedAQuery`
and `UserAcceptedSpellcheckQuery` events.
```vue
<template>
<SpellcheckButton />
</template>
<script setup>
import { SpellcheckButton } from "@empathyco/x-components/search";
</script>
```
```vue
<template>
<SpellcheckButton>
<template
<span class="x-spellcheck__text">
Set the Spellcheck as the new query: {{ spellcheckedQuery }}!
</span>
</template>
</SpellcheckButton>
</template>
<script setup>
import { SpellcheckButton } from "@empathyco/x-components/search";
</script>
```