Appearance
useCategory
Definition
Composable to get the category from current CMS context
Basic usage
ts
const { category } = useCategory(category);
Signature
ts
export function useCategory(category?: Ref<Category>): UseCategoryReturn
Parameters
Name | Type | Description |
---|---|---|
category | Ref<Category> |
Return type
See UseCategoryReturn
ts
export type UseCategoryReturn = {
/**
* Current category entity
*/
category: ComputedRef<Category>;
};
Properties
Name | Type | Description |
---|---|---|
category | ComputedRef<Category> | Current category entity |
Usage
ts
import { useCategory } from "@shopware-pwa/composables-next";
const { search } = useCategory();