Home
NexoPOS

ns-select

Overview

The ns-select component renders a native select input from field.options. The selected value is written to field.value.

The component can flatten nested option groups. Parent options that contain child options are disabled by default unless an explicit disabled value is provided.

Props

  • field: required field definition.
  • name, placeholder, and leading: optional compatibility props.

Options

  • Each option should provide label and value.
  • Set disabled to prevent selecting an option.
  • Nested options use an array as value; the component renders the children with a visual hierarchy.
const field = {
    name: 'category_id',
    label: 'Category',
    type: 'select',
    value: null,
    options: [
        { label: 'Food', value: 1 },
        { label: 'Services', value: 2, disabled: true }
    ],
    errors: []
};
<ns-select :field="field">Category</ns-select>