🔗 Composables
Interfaces
ModuleOptions
Properties
Property | Type |
---|---|
autoImports? | boolean |
SearchOptions
Properties
Property | Type | Description |
---|---|---|
with? | SearchV2With | An object describing which data the returned suggestions/results should contain. |
UseSearchReturn
Properties
Property | Type | Description |
---|---|---|
categories | ComputedRef <CategorySearchSuggestion []> | List of category suggestions within the data |
data | Ref <undefined | SearchV2SuggestionsEndpointResponseData > | Raw data of getSearchSuggestions rpc call. |
error | Ref <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. |
hasSearchQuery | ComputedRef <boolean > | Boolean indicating whether there is a search query set. |
hasSuggestions | ComputedRef <boolean > | Boolean indicating whether there are any product suggestions. |
navigationItems | ComputedRef <NavigationItemSuggestion []> | List of navigation item suggestions within the data |
products | ComputedRef <ProductSearchSuggestion []> | List of product suggestions within the data |
resetSearch | () => void | Function to reset status , data and searchQuery . |
resolveSearch | () => Promise <... | ... | ...> | Resolved the current search query to a single search result. |
searchQuery | Ref <string > | Current search query. |
status | Ref <Status > | Status of getSearchSuggestions rpc call. |
totalCount | ComputedRef <number > | Total count of suggestions |
Variables
module
Functions
useSearch()
A composable that provides a way to fetch and manage search suggestions and results.
Parameters
Parameter | Type | Description |
---|---|---|
option | undefined | SearchOptions | An object containing options for the search request. |
Returns
An object containing reactive data and computed properties for managing search results and suggestions.