Ledger Nano X - The secure hardware wallet
SHARE
TWEET

vue isNumber

krot Jan 25th, 2020 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <input type="text" v-on:keypress="isNumber"/>
  2. methods: {
  3.      isNumber:function($event){
  4.         let keyCode = ($event.keyCode ? $event.keyCode : $event.which);
  5.         if ((keyCode < 48 || keyCode > 57) && keyCode !== 46) { // 46 is dot
  6.             $event.preventDefault();
  7.         }
  8.      }
  9.  
  10.   },
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top