Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Number input component with controls

License

NotificationsYou must be signed in to change notification settings

JayeshLab/vue-numeric-input

Repository files navigation

npmnpmBuild Statuscodecovnpm

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

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

Global

Register VueNumericInput globally:

importVuefrom'Vue';importVueNumericInputfrom'vue-numeric-input';Vue.use(VueNumericInput)

Local

Include the VueNumericInput directly into your component using import:

importVueNumericInputfrom'vue-numeric-input'exportdefault{components:{    VueNumericInput}}

Usage

Basic usage

<template><div><vue-numeric-inputv-model="value":min="1":max="10":step="2"></vue-numeric-input></div></template><script>exportdefault{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 byreact-numeric-input

License

MIT

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp