1 min read
BaseResultLink
BaseResultLink
Component to be reused that renders an <a>
wrapping the result contents.
Props
Name | Description | Type | Default |
---|---|---|---|
result | (Required) The @empathyco/x-types#Result information. | Result |
|
Slots
Name | Description | Bindings (name - type - description) |
---|---|---|
default | (Required) Link content with a text, an image, another component or both | result Result - Result data |
Events
This component emits the following event:
The component can emit more events on click using the resultClickExtraEvents
prop.
See it in action
This component is a wrapper for the result contents (images, name, price...) It may be part of the search result page, recommendations or other section which needs to include results.
Additionally, this component may be injected other events to be emitted on click event, so, depending where it's used its father component may provide this events.
The result prop is required. It will render a <a></a>
with the href to the result URL:
<BaseResultLink :result="result">
<template #default="{ result }">
<img :src="result.images[0]"/>
<span>{{ result.name }}</span>
</template>
</BaseResultLink>