useField function

Module @runic-artifex/vue in @runic-artifex/vue 0.23.0

function useField<TClient extends ViewClient, TValue>(view: TextFieldView<TClient>, field: BridgeField<NoInfer<TClient>, NoInfer<TClient>["snapshot"], TValue> | FieldDefinition<NoInfer<TClient>, NoInfer<TClient>["snapshot"], TValue>, options?: FieldOptions<TValue>): FieldHandle<TValue>;

Binds an element to one View member while the current effect scope is active, through createFieldController: pass a generated descriptor such as EditorFields.title, or any definition with read and write. The handle is reactive; bind v-model to its value (text for number inputs) and call commit on blur. v-model already writes nothing while an IME composition is in progress. options are read once, when the field is created. Call it in setup() or effectScope().run(): outside an effect scope it is never released (development builds warn). ```vue const editor = useView(() => props.page); const title = useField(editor, EditorFields.title, { commit: "pause", checked: true }); <input v-model="title.value"