/**version-1.0*/
let tmixins = {};
import PopupManager from 'element-ui/src/utils/popup/popup-manager.js'
tmixins = {
  name: 'confirmDialog',
  props: {},
  created() {
    if(this.$baseEventBus.isMobile){
      this.zIndex = PopupManager.nextZIndex();
    }
  },
  data() {
    return {
      title: this.$t2('提示', 'components.confirmDialog.title'),
      content: "",
      showWrap: false,
      zIndex:null
    }
  },
  methods: {
    showMsgBox: function () {
      if(this.content){
        this.content = this.content.replace(/(\r\n|\n|\r)/gm, "<br/>");
      }
      this.showWrap = true;
      this.promise = new Promise((resolve, reject) => {
        this.resolve = resolve;
        this.reject = reject;
      });
      // 返回promise对象
      return this.promise;
    }
  }
};
export const mixins = tmixins
