Skip to content
This repository was archived by the owner on Jul 25, 2022. It is now read-only.

joseluisq/vue-input-number

Repository files navigation

vue-input-number

A custom input number component for Vue.js 2.

Install

Yarn

yarn add vue-input-number --dev

NPM

npm install vue-input-number --save-dev

Prerequisites

Usage

<template> <input-number :step="1" :min="10" :max="100" :maxlength="3" @onInputNumberChange="onChange"></input-number> </template> <script> export default { methods: { onChange (value) { console.log(value) } } } </script>

In your entry app:

const Vue = require('vue') Vue.component('vue-input-number', require('vue-input-number')) const app = new Vue({ el: '#app' })

For more detailed example check out the app directory.

Attributes

  • step: Step value for increment and decrement the input number value.
  • min: Minimum value for input number.
  • max: Maximum value for input number.
  • maxlength: Maxlength for the input number.

Events

@onInputNumberChange

Event is fired when value is changed.

License

MIT license

© 2017 José Luis Quintana

About

A custom input number component for Vue.js 2

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •