@empathyco/x-components
Version:
Empathy X Components
41 lines (38 loc) • 1.24 kB
JavaScript
import { defineComponent, computed } from 'vue';
import BaseSuggestion from '../../../components/suggestions/base-suggestion.vue.js';
import { popularSearchesXModule } from '../x-module.js';
/**
* Renders a popular search item which receives the suggestion that will be rendered as a prop. It
* exposes a default slot to change the popular search content. If the slot is not overridden,
* it will render the suggestion query by default.
*
* @public
*/
var _sfc_main = defineComponent({
name: 'PopularSearch',
xModule: popularSearchesXModule.name,
components: { BaseSuggestion },
props: {
/**
* The suggestion to render and use in the default slot.
*
* @public
*/
suggestion: {
type: Object,
required: true,
},
},
setup(props) {
/**
* Events list which are going to be emitted when a popular search is selected.
*
* @returns The {@link XEvent} to emit.
* @public
*/
const events = computed(() => ({ UserSelectedAPopularSearch: props.suggestion }));
return { events };
},
});
export { _sfc_main as default };
//# sourceMappingURL=popular-search.vue2.js.map