ns-input
Overview
The ns-input component renders text-like fields such as text, password, email, number, and telephone inputs. It binds directly to field.value with v-model.
Most form input components expect a field object. Common keys include name, label, value, type, placeholder, description, errors, disabled, options, prefix, suffix, data, and component depending on the component being rendered.
Props
field: required field definition.type: overridesfield.type; defaults to text.leading: displays a leading label inside the input.placeholder: legacy prop; the component primarily readsfield.placeholder.
Field keys
field.namecontrols the input id.field.labelcontrols the label when provided through the default slot.field.valuestores the input value.field.placeholdersets placeholder text.field.disableddisables the control.field.prefixandfield.suffixrender fixed text inside the input.field.errorsmarks the component as invalid and is displayed byns-field-description.
const field = {
name: 'email',
label: 'Email',
type: 'email',
value: '',
placeholder: '[email protected]',
errors: []
};
<ns-input :field="field">Email</ns-input>