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

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
| Name | Description | Type | Required | Default |
|---|---|---|---|---|
| horizontal | - | Boolean | false | true |
| vid | - | String | false | "" |
| value | - | — | false | null |
| labelInside | - | Boolean | false | false |
| labelOnBorder | - | Boolean | false | false |
| validationMode | - | String | false | "aggressive" |
| hideValidation | - | Boolean | false | false |
| isRequired | - | Boolean | false | true |
| min | Minimum allowed value | Number | false | - |
| max | Maximum allowed value | Number | false | - |
| step | Incremental number step | Number | false | 1 |
| controlsRounded | - | Boolean | false | true |
| controls | - | Boolean | false | true |
| controlsPosition | Position of controls | String | false | "" |
| controlsAlignment | - | String | false | "left" |
| units | Items select | Array | false | unit(s) |
| optionId | Id of the option in Select when option is Object | String | false | undefined |
| optionName | Display text of the option in Select when option is Object | String | false | undefined |
| showClearIcon | - | Boolean | false | false |
| clearIconSize | - | String | false | "is-small" |
| clearIconCustomClass | - | String | false | "" |
| locale | Locale string {en, es ...} for display language on component | String | false | "en" |
| converter | All adviable modules from Units Converter A simple library to convert units. Heavily based on convert-units. (https://www.npmjs.com/package/units-converter) | String | false | null |
| baseUnit | All adviable Units from Units Converter A simple library to convert units. Heavily based on convert-units. (https://www.npmjs.com/package/units-converter) | String | false | null |
| unit | - | String | false | null |
Events
| Event Name | Description | Parameters |
|---|---|---|
| unit-change | - | - |
| input | - | - |