useProduct
Category:
Product
Composable for product management.
Types
ts
export function useProduct(
product?: Ref<Schemas["Product"]> | Schemas["Product"],
configurator?: Ref<Schemas["PropertyGroup"][]> | Schemas["PropertyGroup"][],
): UseProductReturn
ts
export type UseProductReturn = {
/**
* Returns product object
* {@link Product} object
*/
product: ComputedRef<Schemas["Product"]>;
/**
* {@link PropertyGroup} array that defines the product possible configurations
*/
configurator: ComputedRef<Schemas["PropertyGroup"][]>;
/**
* Merges the current product with the new variant data
* @param variant - {@link Product} object with the new variant data
*/
changeVariant(variant?: Partial<Schemas["Product"]>): void;
};