0.0.6 • Published 2 years ago

vue-numeric-input-next v0.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Vue Numeric Input Next

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

Installation

Install via NPM

$ npm install vue-numeric-input-next

or

$ yarn add vue-numeric-input-next

Global

Register VueNumericInput globally:

import { createApp } from 'Vue';
import VueNumericInput from 'vue-numeric-input-next';

const app = createApp()
app.use(VueNumericInput)

Local

Include the VueNumericInput directly into your component using import:

import { VueNumericInputNext } from 'vue-numeric-input-next'

Usage

Basic usage

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

<script setup>
import { ref } from 'vue'
const value = ref(0)
</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
update:modelValuetriggers 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 vue-numeric-input

License

MIT

0.0.6

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago