index.js 610 B

123456789101112131415161718192021222324
  1. import Vue from 'vue'
  2. import App from './App'
  3. Vue.config.productionTip = false
  4. Vue.config.silent = true
  5. openerp.vue_module = (instance, local) => {
  6. local.VueWidget = instance.Widget.extend({
  7. start() {
  8. this.vm = new Vue({
  9. el: this.el,
  10. template: '<App />',
  11. components: { App }
  12. })
  13. },
  14. destroy() {
  15. this.vm.$destroy()
  16. $(this.vm.$el).remove()
  17. this.vm = null
  18. }
  19. })
  20. instance.web.client_actions.add('vue_module.vue_module_action', 'instance.vue_module.VueWidget')
  21. }