Skip to content

useSwProps() ​

WARNING

Single File Component (SFC) support for Administration extensions is experimental. It is available since Shopware 6.7.16.0. The APIs described on this page can still change without a deprecation. Try it out and tell us what you find, but do not ship an extension built on it to customers or to the Shopware Store until the API is declared stable (planned for 6.9).

ts
function useSwProps<T extends Record<PropertyKey, any>>(): T;

Provided by the build in every .override.vue file; you never import it. Returns the props the overridden component was given.

ts
const props = useSwProps();

const label = computed(() => `Editing ${props.name}`);

Read only. Props come from whoever renders the component, so swDefineOverride() rejects a prop name with a console error. To change what a prop-derived value produces, override the binding that derives it.

A base component does not need this: it declares its own props with defineProps().

Was this page helpful?
UnsatisfiedSatisfied
Be the first to vote!
0.0 / 5  (0 votes)