@empathyco/x-components
Version:
Empathy X Components
48 lines (45 loc) • 1.29 kB
JavaScript
import { defineComponent } from 'vue';
import { useXBus } from '../../../composables/use-x-bus.js';
import { searchXModule } from '../x-module.js';
/**
* A promoted result is just an item that has been inserted into the search results to advertise
* something. Usually it is one of the first items in the grid, and has the same shape as a
* result. It just contains a link to the promoted content, an image, and a title.
*
* Additionally, this component exposes the following props to modify the classes of the
* elements: `titleClass`.
*
* @public
*/
var _sfc_main = defineComponent({
name: 'Promoted',
xModule: searchXModule.name,
props: {
/**
* The promoted data.
*
* @public
*/
promoted: {
type: Object,
required: true,
},
titleClass: String,
},
setup(props) {
const xBus = useXBus();
/**
* Emits the promoted click event.
*
* @internal
*/
const emitUserClickedAPromoted = () => {
xBus.emit('UserClickedAPromoted', props.promoted);
};
return {
emitUserClickedAPromoted,
};
},
});
export { _sfc_main as default };
//# sourceMappingURL=promoted.vue2.js.map