index.js 548 Bytes
Newer Older
Nature's avatar
Nature committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
import Vue from 'vue'

import numberKeyboard from './index.vue'

import elementUtil from '../../common/scripts/elementUtil'

class VueKeyboard {
  constructor () {
    this._vm = undefined
  }
  show (option) {
    elementUtil.createElement('vum-show-keyborad')
    this._vm = new Vue(numberKeyboard)
    this._vm.$mount('[vum-show-keyborad]')
    setTimeout(() => {
      this._vm.showNumberKeyboard(option)
    })
  }

  onClose () {
    this._vm.onClose()
  }

  onPressKey () {
    this._vm.onPressKey()
  }
}

export default new VueKeyboard()