docs
  1. Features
  2. Search
  3. Composables

Interfaces

ModuleOptions

Properties

PropertyType
autoImports?boolean

SearchOptions

Properties

PropertyTypeDescription
with?SearchV2WithAn object describing which data the returned suggestions/results should contain.

UseSearchReturn

Properties

PropertyTypeDescription
categoriesComputedRef<CategorySearchSuggestion>List of category suggestions within the data
dataRef<undefined | SearchV2SuggestionsEndpointResponseData>Raw data of getSearchSuggestions rpc call.
errorRef<unknown>Error of getSearchSuggestions rpc call. undefined when no error occurred.
getSearchSuggestions() => Promise<void>Function to fetch search suggestions based on the current search query.
hasSearchQueryComputedRef<boolean>Boolean indicating whether there is a search query set.
hasSuggestionsComputedRef<boolean>Boolean indicating whether there are any product suggestions.
navigationItemsComputedRef<NavigationItemSuggestion>List of navigation item suggestions within the data
productsComputedRef<ProductSearchSuggestion>List of product suggestions within the data
resetSearch() => voidFunction to reset status, data and searchQuery.
resolveSearch() => Promise<... | ... | ...>Resolved the current search query to a single search result.
searchQueryRef<string>Current search query.
statusRef<Status>Status of getSearchSuggestions rpc call.
totalCountComputedRef<number>Total count of suggestions

Variables

module

Functions

useSearch()

A composable that provides a way to fetch and manage search suggestions and results.

Parameters

ParameterTypeDescription
optionundefined | SearchOptionsAn object containing options for the search request.

Returns

UseSearchReturn

An object containing reactive data and computed properties for managing search results and suggestions.