v-numeric

0.1.1 • Public • Published

v-numeric

bundlephobia minified size npm package version github license js standard style

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>

Readme

Keywords

Package Sidebar

Install

npm i v-numeric

Weekly Downloads

13

Version

0.1.1

License

MIT

Unpacked Size

476 kB

Total Files

10

Last publish

Collaborators

  • n2name