UnitSelectorNumberComponent

This component allows you to create a unit selector component and select its options

Example

UnitSelectorNumberComponent

export default {
  name: "App",
  data() {
    return {
      form: {
        servicesDefinition: {
          type: UnitSelectorNumberComponent,
          default: 0,
          "field-wrapper": { class: "is-12" },
          "field-input": {
            isRequired: false,
            label: "label",
            expanded: true,
            showClearIcon: true,
            units: ["KB", "MB", "GB"],
            baseUnit: "B",
            converter: "digital",
            unit: "KB",
            min: 0,
          },
          events: {
            "unit-change": (val) => {},
          },
        },
      },
    };
  },
};

Props

NameDescriptionTypeRequiredDefault
horizontal-Booleanfalsetrue
vid-Stringfalse""
value-falsenull
labelInside-Booleanfalsefalse
labelOnBorder-Booleanfalsefalse
validationMode-Stringfalse"aggressive"
hideValidation-Booleanfalsefalse
isRequired-Booleanfalsetrue
minMinimum allowed valueNumberfalse-
maxMaximum allowed valueNumberfalse-
stepIncremental number stepNumberfalse1
controlsRounded-Booleanfalsetrue
controls-Booleanfalsetrue
controlsPositionPosition of controlsStringfalse""
controlsAlignment-Stringfalse"left"
unitsItems selectArrayfalseunit(s)
optionIdId of the option in Select when option is ObjectStringfalseundefined
optionNameDisplay text of the option in Select when option is ObjectStringfalseundefined
showClearIcon-Booleanfalsefalse
clearIconSize-Stringfalse"is-small"
clearIconCustomClass-Stringfalse""
localeLocale string {en, es ...} for display language on componentStringfalse"en"
converterAll adviable modules from Units Converter A simple library to convert units. Heavily based on convert-units. (https://www.npmjs.com/package/units-converter)Stringfalsenull
baseUnitAll adviable Units from Units Converter A simple library to convert units. Heavily based on convert-units. (https://www.npmjs.com/package/units-converter)Stringfalsenull
unit-Stringfalsenull

Events

Event NameDescriptionParameters
unit-change--
input--