A Vue.js number input component with optional increment/decrement controls, offering a customizable alternative to native number inputs. Version 2.0.0 is built for Vue 2.x and distributed as a UMD/CommonJS bundle via npm. It provides props for min/max, step, precision, alignment, size, mousewheel support, and control types (plus/minus or up/down). Unlike native inputs, it gives visual controls and consistent cross-browser behavior. The library is published as a single-file component, intended for global or local registration. No updates since 2020; consider it maintenance-only for Vue 2 projects.
npm install vue-numeric-inputVerified import paths — ran on the pinned version, not inferred.
Shows global registration of VueNumericInput and basic usage with v-model, min, max, step, and precision props.
Use Vue 2.x or upgrade to a Vue 3 compatible alternative.
Explicitly set min and max props to enforce bounds.
Always use v-model with a data property initialized to a number.
Sanitize the v-model value in your component if exact precision is required.
Set :mousewheel="true" to enable mousewheel increment/decrement.
Ensure you import the default export: import VueNumericInput from 'vue-numeric-input'. Avoid destructuring.
Add value: 0 (or appropriate number) to your component's data() return object.
Register via Vue.use(VueNumericInput) globally, or add to components option locally.
Use v-model.number modifier or ensure initial data is numeric; use :min="1" (bind) not min="1".