模仿饿了么UI设计全局消息框

  import MessageBox from 'XXX.vue'
let MessageConstructor = Vue.extend(MessageBox);
const Message = function (options) {
let options = {
data:options
}
 let instances = MessageConstructor(options);
 instances.vm = instances .$mount();
document.body.appendChild(instances.vm.$el);
return instance.vm;
}
/***
  删除组件
***/ 
destroyElement: function destroyElement() {
       //this.$el.addEventListener('transitionend', this.destroyElement);
      this.$el.removeEventListener('transitionend', this.destroyElement);
      this.$destroy(true);
      this.$el.parentNode.removeChild(this.$el);
    }

你可能感兴趣的:(模仿饿了么UI设计全局消息框)