0.4.0 • Published 5 years ago

@jzolago/vuetify-number-input v0.4.0

Weekly downloads
180
License
GPL-3.0-only
Repository
-
Last release
5 years ago

vuetify-number-input

vuetify-number-input is a simple wrapper for the Vuetify Text Field UI component for incrementing and decrementing numerical input.

demo

Installation

Install the package from npm:

npm install --save @jzolago/vuetify-number-input

Add the package to your app entry point:

import Vue from 'vue'
import VuetifyNumberInput from '@jzolago/vuetify-number-input'

Vue.use(VuetifyNumberInput);

Usage

Once the plugin has been installed, you can now use the v-input-number component in your templates. Use v-model to bind to the value.

<template>
	<v-input-number v-model="qty"></v-input-number>
</template>

<script>
export default {
	data() {
		return {
			qty: 0,
		};
	},
};
</script>

The v-input-number component

The component extends the Vuetify v-text-field component.

Props:

Propdescriptiontypedefault
labelSet input labelString''
minSets minimum valueNumber0
maxSets maximum valueNumber9999
maxLengthSets maximum number of digits. Must align with maxNumber4
outlineSets outline style to the inputBooleantrue
rulesAn array of functions called for validation that should either return true or a String error message. See Vuetify Text Field docs for details.Array[]
stepSets amount to be added/subtracted when using +/- iconsNumber1
valueInput valueNumber, Stringundefined

Events:

@input: Emitted when value is changed using +/- icons or after user input.