1 min read

BaseResultAddToCart

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.

Props

Name Description Type Default
result (Required) The @empathyco/x-types#Result information. Result

Slots

Name Description Bindings
(name - type - description)
default (Required) Button content with a text, an icon or both None

Events

A list of events that the component will emit:

Examples

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.

Basic example

This component is a button to emit UserClickedResultAddToCart whe clicked by the user

<BaseResultAddToCart :result="result">
  <img src="./add-to-cart.svg" />
  <span>Add to cart</span>
</BaseResultAddToCart>