Godofbrowser / vuejs-dialog

A lightweight, promise based alert, prompt and confirm dialog
MIT License
351 stars 111 forks source link

Internet Explorer 11 incompatible #61

Open hungnv-sr opened 4 years ago

hungnv-sr commented 4 years ago

I haven't try with other version of IE, and I tried to upgrade windows and IE but no luck so far. Error: SCRIPT5007: Unable to get property 'apply' of undefined or null reference line 668 in vuejs-dialog.min.js I tried babel polyfill but still get the error.

dinhducit commented 4 years ago

I faced the same issue. Any solutions?

AmphibiousMelon commented 4 years ago

I faced this issue and solved it by including a polyfill for Object.assign before loading vuejs-dialog.

if (typeof Object.assign !== 'function') {
  // Must be writable: true, enumerable: false, configurable: true
  Object.defineProperty(Object, "assign", {
    value: function assign(target, varArgs) { // .length of function is 2
      'use strict';
      if (target === null || target === undefined) {
        throw new TypeError('Cannot convert undefined or null to object');
      }

      var to = Object(target);

      for (var index = 1; index < arguments.length; index++) {
        var nextSource = arguments[index];

        if (nextSource !== null && nextSource !== undefined) {
          for (var nextKey in nextSource) {
            // Avoid bugs when hasOwnProperty is shadowed
            if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
              to[nextKey] = nextSource[nextKey];
            }
          }
        }
      }
      return to;
    },
    writable: true,
    configurable: true
  });
}

import VuejsDialog from 'vuejs-dialog';
window.Vue.use(VuejsDialog);