v-numeric
v0.1.1
Published
[![bundlephobia minified size](https://badgen.net/bundlephobia/min/v-numeric)](https://bundlephobia.com/result?p=v-numeric) [![npm package version](https://badgen.net/npm/v/v-numeric)](https://npm.im/v-numeric) [![github license](https://badgen.net/gith
Downloads
136
Readme
v-numeric
Vue 2.x directive for numeric value restriction of input element.
Install
$ npm i --save v-numeric
Note
- Support oneway update from an input element to a model.
Usage
import Vue from 'vue'
const numeric = require('v-numeric').default;
Vue.use(numeric)
- Should use input type="text" instead of "number"
- Should use custom 'bind' parameter instead of v-model bind
<template>
<input
type="text"
v-numeric="{ min: 0, max: 100, decimal: 2, bind: 'myData.somedata' }" />
</template>
<script>
...
myData = {
somedata = '';
}
...
</script>