Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

52 lines
2.2 KiB

var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
import Swal from 'sweetalert2/dist/sweetalert2.js';
export * from 'sweetalert2';
var VueSweetalert2 = (function () {
function VueSweetalert2() {
}
VueSweetalert2.install = function (vue, options) {
var _a;
var swalLocalInstance = options ? Swal.mixin(options) : Swal;
var swalFunction = function () {
var _a;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return (_a = swalLocalInstance.fire).call.apply(_a, __spreadArrays([swalLocalInstance], args));
};
var methodName;
for (methodName in swalLocalInstance) {
if (Object.prototype.hasOwnProperty.call(swalLocalInstance, methodName) &&
typeof swalLocalInstance[methodName] === 'function') {
swalFunction[methodName] = (function (method) {
return function () {
var _a;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return (_a = swalLocalInstance[method]).call.apply(_a, __spreadArrays([swalLocalInstance], args));
};
})(methodName);
}
}
if (((_a = vue.config) === null || _a === void 0 ? void 0 : _a.globalProperties) && !vue.config.globalProperties.$swal) {
vue.config.globalProperties.$swal = swalFunction;
vue.provide('$swal', swalFunction);
}
else if (!Object.prototype.hasOwnProperty.call(vue, '$swal')) {
vue.prototype.$swal = swalFunction;
vue['swal'] = swalFunction;
}
};
return VueSweetalert2;
}());
export default VueSweetalert2;
//# sourceMappingURL=index.js.map