1.0.3 • Published 6 years ago

vue2-num-keyboard v1.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

vue2-num-keyboard

A Vue.js numeric keyboard

样式

use

npm install vue2-num-keyboard -save

main.js

import numKeyboard from 'vue2-num-keyboard'
Vue.use(numKeyboard)

例子

<template>
  <div id="app">
    <div @click="show=true" style="width: 200px;height: 20px;background: aqua">{{num}}</div>
    <num-keyboard v-model="show" @cb="cb" @></num-keyboard>
  </div>
</template>

<script>
  export default {
    name: 'app',
    data() {
      return {
        num: '',
        show: false
      }
    },
    methods: {
      cb(v) {
        this.num = v
      },
      confirm(v){
        console.log(v)
      }
    }
  }
</script>

api

参数说明默认值
:point是否显示小数点,默认显示true
:decimalDigits是否开启小数位数限制,默认两位小数true
@confirm确认按钮回调 ,可选--