# defineEntityRoute
# Example
<script>
import { defineEntityRoute } from '@jdi/vue-backoffice-library'
export default {
setup(_, context) {
const [handleEntityCreated] = defineEntityRoute(context, 'customerId')
return {
handleEntityCreated
}
}
}
</script>
Note 1: the customerId
argument needs to consist of the entity name plus 'Id'.
This is enforced in useRoute
Note 2: defineEntityRoute
returns a tuple, not an object as is the case with
other composables.