index.js 509 B

12345678910111213141516171819202122
  1. import Vue from 'vue'
  2. import vKeyboard from './VKeyboard'
  3. //extend创建Vue组件类
  4. const vKeyboardClass = Vue.extend(vKeyboard)
  5. let instance;
  6. export default {
  7. activate(options) {
  8. options = options || {};
  9. instance = new vKeyboardClass({propsData: options});
  10. instance.vm = instance.$mount();
  11. document.body.appendChild(instance.vm.$el);
  12. /*document.body.appendChild(instance.vm.$el);*/
  13. instance.activate();
  14. return instance;
  15. },
  16. deactivate() {
  17. instance.deactivate();
  18. }
  19. }