Skip to content

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

NameTypeRequiredDescription
optionsDetailViewOptionsyes
formInitialValueanyyesReactive target populated with the fetched object data on each successful load.

Returns

DetailViewContext

Source

client/lib/use/useDetailView.js:148

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2