0.5.5 • Published 12 months ago

vue3-rolling-number-input v0.5.5

Weekly downloads
-
License
BSD-3-Clause
Repository
-
Last release
12 months ago

vue3-rolling-number-input

This branch contains a version of the RollingNumberInput that supports Vue 3.

RollingNumberInput is a Vue component that provides a number input field with digits that can be quickly individually adjusted using a mouse wheel or arrow keys on a keyboard. It is ideal for situations such as inputting radio frequencies or distances where users may want to spin through values and need to dynamically change what degree of precision they are modifying.

Attributes

RollingNumberInput

AttributeTypeRequired?DefaultUsage
allowNegativeBooleanNofalsetrue to display the +/- field and allow negative numbers; false to only allow >= 0
centerClassStringNorolling-number-input-centerCSS class to apply to digits other than the leftmost and rightmost digits
digitClassStringNorolling-number-input-digitCSS class to apply to all digits
leftClassStringNorolling-number-input-leftCSS class to apply to the leftmost digit
maxNumberNoundefinedMaximum allowed value; if undefined, will be the largest value that can be displayed in the visible number of digits.
minNumberNoundefinedMinimum allowed value; if undefined, will be 0 if allowNegative is false or -max if allowNegative is true.
nameStringNoempty stringName of the HTML input for form submission
precisionNumberNo0Number of digits of decimal precision to display. The precision must be >= 0.
rightClassStringNorolling-number-input-rightCSS class to apply to the rightmost digit
valueNumberYesNumeric value to display in the field
widthNumberYesTotal number of fields to display; note that this includes the sign and decimal, if negative numbers are allowed or the precision is > 0. The width must be >= 1.

Demo

https://hatchbed.github.io/vue-rolling-number-input/

Installation

Install the package through NPM:

npm install vue3-rolling-number-input

Import it into your project:

import RollingNumberInput from 'vue3-rolling-number-input'
import 'vue3-rolling-number-input/dist/style.css'

export default {
  components: {
    RollingNumberInput,
  }
}

Usage example:

    <RollingNumberInput
        class="rolling-input"
        :allow-negative="false"
        :max="1000"
        :min="5"
        :width="8"
        :precision="3"
        v-model="fieldValue"
        @change="$emit('change', $event)"
    />
0.5.5

12 months ago

0.5.4

1 year ago

0.5.3

1 year ago

0.5.2

1 year ago

0.5.1

1 year ago

0.4.6

1 year ago

0.4.5

1 year ago

0.4.4

1 year ago

0.4.3

1 year ago

0.4.2

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago