index.js 920 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import Vue from 'vue'
  2. import App from '@/App'
  3. import VModal from 'vue-js-modal'
  4. import store from '@/store'
  5. Vue.use(VModal)
  6. Vue.config.productionTip = false
  7. Vue.config.silent = true
  8. openerp.eiru_pos = (instance, local) => {
  9. local.PosWidget = instance.Widget.extend({
  10. start() {
  11. instance.eiru_theme.instance.hide()
  12. this.vm = new Vue({
  13. store,
  14. el: this.el,
  15. template: '<App />',
  16. components: {
  17. App
  18. },
  19. data: {
  20. pos_instance: this
  21. }
  22. });
  23. },
  24. destroy() {
  25. this.vm.$destroy()
  26. $(this.vm.$el).remove()
  27. this.vm = null
  28. instance.eiru_theme.instance.show()
  29. }
  30. })
  31. instance.web.client_actions.add('eiru_pos.action_launch', 'instance.eiru_pos.PosWidget')
  32. }