Socket
Socket
Sign inDemoInstall

vue-numeric-input

Package Overview
Dependencies
11
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue-numeric-input

Vue Numeric Input Component


Version published
Weekly downloads
1.2K
decreased by-30.27%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Vue Numeric Input

npm npm Build Status codecov npm

Number input component based on Vue that is a replacement of native input number with optional control.

vue-numeric-input

Live Demo & Doc

Installation

Install via NPM

$ npm install vue-numeric-input --save

Install via CDN

<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/vue-numeric-input"></script>
Global

Register VueNumericInput globally:

import Vue from 'Vue';
import VueNumericInput from 'vue-numeric-input';

Vue.use(VueNumericInput)
Local

Include the VueNumericInput directly into your component using import:

import VueNumericInput from 'vue-numeric-input'

export default {
  components: {
    VueNumericInput
  }
}

Usage

Basic usage
<template>
  <div>
    <vue-numeric-input  v-model="value" :min="1" :max="10" :step="2"></vue-numeric-input>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        value: 1,
      };
    },
  };
</script>
PROPS:
NameDescriptionTypeDefaultOptions
nameComponent nameString--
valueBinding valueNumber--
placeholderInput placeholderString--
minMinimum allowed valueNumber-Infinity-
maxMaximum allowed valueNumberInfinity-
stepIncremental StepNumber1-
alignAlignment of Numeric ValueStringleftleft, center, right
widthComponent WidthString150pxwidth in px, em, rem etc e.g. ‘20px’
sizeComponent SizeStringnormalsize value can be 'small', 'normal', 'large'
precisionNumber of decimalsNumber0Integer value
controlsEnable/Disable ControlsBooleantruetrue/false
controlsTypeControls TypeStringplusminusplusminus/updown
autofocusAutofocus on Page LoadBooleanfalsetrue/false
readonlyIs ReadonlyBooleanfalsetrue/false
disabledIs DisabledBooleanfalsetrue/false
isinputenable/disable keyboard input of numberBooleanfalsetrue/false
mousewheelEnable increment/decrement with mousewheel eventBooleanfalsetrue/false
classNameCss Class for Input ComponentString-css class name
EVENTS:
Event NameDescriptionParameters
inputtriggers when input(newValue)
changetriggers when the value changes(newValue)
blurtriggers when Input blurs(event: Event)
focustriggers when Input focus(event: Event)
METHODS:
MethodDescriptionParameters
focusfocus the Input component-
blurblur the Input component-

Inspired by react-numeric-input

License

MIT

Keywords

FAQs

Last updated on 29 Sep 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc