Vue Numeric is a lightweight input component for Vue.js 2, designed to format and handle numeric values, particularly useful for currency inputs. The library is currently at version 2.5.1 and maintains an active release cadence, primarily focusing on bug fixes and minor feature enhancements. Key functionalities include automatic formatting with currency symbols, customizable thousands and decimal separators, precision control, and defining minimum/maximum constraints. It also offers control over the output type (Number or String) and the value used when the input is empty. Unlike simple HTML input types, vue-numeric provides robust, localized formatting and validation suitable for financial or data entry applications exclusively within Vue 2 ecosystems.
npm install vue-numericVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates importing and globally registering `vue-numeric` as a Vue plugin, then using the component with various props like currency symbol, precision, separators, and min/max constraints, along with `v-model` binding for both Number and String output types.
Review components using `vue-numeric` with placeholder logic or expecting an initial `0` value from an empty `v-model`. Adjust initialization or `empty-value` prop if the new behavior is undesirable.
Be aware of this automatic decimal separator change when configuring `separator`. If `.` or `space` is used for thousands, ensure your locale and user expectations align with a comma decimal separator.
Ensure your project is running Vue 2.x. For Vue 3 projects, consider alternative numeric input components built specifically for Vue 3.
Simply use `Vue.use(VueNumeric)` when importing via `import VueNumeric from 'vue-numeric'`.
Ensure that any variable used with `v-model` (e.g., `price` in `<vue-numeric v-model="price">`) is properly initialized within the `data` object of your Vue component.
Update to v2.4.1 or later. Ensure your `v-model` is initialized to an empty string (`''`) or explicitly use the `empty-value` prop (e.g., `:empty-value="''"`) if you desire an empty input visually and as a bound value.
No dependency data recorded yet.