Composables
WARNING
Experimental since 6.7.16.0: the APIs can change without a deprecation, so do not ship on them yet. Give us feedback.
All composables the Administration offers are experimental. Their names, options and return values can still change without a deprecation, so note which ones you rely on and tell us when one of them does not fit what you are building.
Override composables
Three of them are provided by the build in every .override.vue file. Like the macros, you never import them, and they exist only inside an override file. They are how an override reaches the component it overrides.
A base component needs none of them: it declares its own props with defineProps() and its own events with defineEmits().
Administration composables
Everything else is imported by name from the shopware:composables virtual module:
import { useNotification } from 'shopware:composables';Each composable is also available as a default export of its own import path, named after it in camelCase (import useNotification from 'shopware:composables/useNotification').
Each of them is the Composition API side of a mixin. A mixin declared its own props and read them off this; a composable has neither, so whatever the mixin used to take from its host is passed in, and getters keep it reactive:
const { isBetween, betweenValue } = useRuleBetweenOperator({
condition: () => props.condition,
ensureValueExist: () => emit('ensure-value-exist'),
});The mixins stay where they are, so an Options API component that has not been migrated keeps working.