HistoryQuery

HistoryQuery

This component renders a history query suggestion combining two buttons: one for selecting this suggestion as the search query, and another one to remove this query suggestion from the history queries.

Props

Name Description Type Default
suggestion The history query suggestion to render. HistoryQueryModel

Slots

Name Description Bindings
(name - type - description)
default History Query content suggestion Suggestion - History Query suggestion data
queryHTML string - Suggestion's query with the matching part inside a span tag
remove-button-content History Query remove button content suggestion Suggestion - History Query suggestion data

Examples

Basic usage

This component only requires a prop called suggestion

Customizing slots content

Suggestion and remove buttons contents can be customized.

The default slot allows you to replace the content of the suggestion button. It has two properties, the suggestion itself, and a string of HTML with the matched query.

The other slot is called remove-button-content, and allows you to set the content of the button that serves to remove this query from the history. This slot only has one property, the suggestion.

Events

A list of events that the component will emit:

  • UserSelectedAHistoryQuery: the event is emitted after the user clicks the button. The event payload is the history query data.
We are cookie-less

This is a cookie-free area. Who needs cookies when you can have trust? Feel free to browse our site and the only cookies you need to worry about are the edible kind.