useDetailView
Overview
Extracts all reactive state and wiring for a detail view of a single model instance. The caller owns the template; this composable owns object fetching, action availability, error combination, and populating formInitialValue from the fetched object.
Pass the component's props directly as options — the composable reads what it needs via reactive property access. formInitialValue must be a reactive object (or a ref to one); the composable watches the fetch and assigns the object data into it automatically.
Theme, slot name resolution, useSlots, defineEmits, and onMounted event emission are all caller responsibilities and are not handled by this composable.
Signature
useDetailView(options, formInitialValue)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| options | DetailViewOptions | yes | |
| formInitialValue | any | yes | Reactive target populated with the fetched object data on each successful load. |
Returns
Source
client/lib/use/useDetailView.js:148