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>