@empathyco/x-components
Version:
Empathy X Components
46 lines (29 loc) • 1.67 kB
Markdown
---
title: BaseResultAddToCart
---
Renders a button with a default slot. It receives the result with the data and emits
XEventsTypes.UserClickedResultAddToCart to the bus on click mouse event.
| Name | Description | Type | Default |
| ------------------- | ----------------------------------------------------- | ------------------- | ------------- |
| <code>result</code> | (Required) The @empathyco/x-types
| Name | Description | Bindings<br />(name - type - description) |
| -------------------- | ------------------------------------------------------ | ----------------------------------------- |
| <code>default</code> | (Required) Button content with a text, an icon or both | None |
A list of events that the component will emit:
- [`UserClickedResultAddToCart`](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 result data.
Renders a button with a default slot. It receives the result with the data and emits an event
`UserClickedResultAddToCart` to the bus on click mouse event.
This component is a button to emit `UserClickedResultAddToCart` whe clicked by the user
```vue
<BaseResultAddToCart :result="result">
<img src="./add-to-cart.svg" />
<span>Add to cart</span>
</BaseResultAddToCart>
```