Appearance
createListingComposable
Definition
Factory to create your own listing.
By default you can use useListing composable, which provides you predefined listings for category(cms) listing and product search listing. Using factory you can provide our own compatible search method and use it for example for creating listing of orders in my account.
Signature
ts
export function createListingComposable<ELEMENTS_TYPE>({
searchMethod,
searchDefaults,
listingKey,
}: {
searchMethod(
searchParams: Partial<ShopwareSearchParams>,
): Promise<ListingResult<ELEMENTS_TYPE>>;
searchDefaults: ShopwareSearchParams;
listingKey: string;
}): UseListingReturn<ELEMENTS_TYPE>
Parameters
Name | Type | Description |
---|---|---|
{ searchMethod, searchDefaults, listingKey, } | { searchMethod( searchParams: Partial<ShopwareSearchParams>, ): Promise<ListingResult<ELEMENTS_TYPE>>; searchDefaults: ShopwareSearchParams; listingKey: string; } |
Return type
ts
UseListingReturn<ELEMENTS_TYPE>
Properties
Name | Type | Description |
---|
Methods
Name | Type | Description |
---|
Usage
vue
<script setup lang="ts">
// TODO: add example
</script>