Comparing version 2.1.1 to 2.1.2
@@ -10,7 +10,8 @@ "use strict"; | ||
var isV3 = typeof app !== 'function'; | ||
var variate = '$ajax'; | ||
if (isV3) { | ||
app.config.globalProperties.$ajax = XEAjax; | ||
app.config.globalProperties[variate] = XEAjax; | ||
} else { | ||
Object.defineProperty(app.prototype, '$ajax', { | ||
Object.defineProperty(app.prototype, variate, { | ||
get: function get() { | ||
@@ -17,0 +18,0 @@ XEAjax.$context = this; |
@@ -23,7 +23,8 @@ (function (global, factory) { | ||
var isV3 = typeof app !== 'function'; | ||
var variate = '$ajax'; | ||
if (isV3) { | ||
app.config.globalProperties.$ajax = XEAjax; | ||
app.config.globalProperties[variate] = XEAjax; | ||
} else { | ||
Object.defineProperty(app.prototype, '$ajax', { | ||
Object.defineProperty(app.prototype, variate, { | ||
get: function get() { | ||
@@ -30,0 +31,0 @@ XEAjax.$context = this; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){if("function"==typeof define&&define.amd)define("vxe-ajax",["exports"],t);else if("undefined"!=typeof exports)t(exports);else{var o={exports:{}};t(o.exports),e.VXEAjax=o.exports.default}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:this,function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;function t(e,t){"function"!=typeof e?e.config.globalProperties.$ajax=t:Object.defineProperty(e.prototype,"$ajax",{get:function(){return t.$context=this,t}})}e.default=t}); | ||
!function(e,t){if("function"==typeof define&&define.amd)define("vxe-ajax",["exports"],t);else if("undefined"!=typeof exports)t(exports);else{var o={exports:{}};t(o.exports),e.VXEAjax=o.exports.default}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:this,function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;function t(e,t){var o="$ajax";"function"!=typeof e?e.config.globalProperties[o]=t:Object.defineProperty(e.prototype,o,{get:function(){return t.$context=this,t}})}e.default=t}); |
function VXEAjax (app, XEAjax) { | ||
var isV3 = typeof app !== 'function' | ||
var variate = '$ajax' | ||
if (isV3) { | ||
app.config.globalProperties.$ajax = XEAjax | ||
app.config.globalProperties[variate] = XEAjax | ||
} else { | ||
Object.defineProperty(app.prototype, '$ajax', { | ||
Object.defineProperty(app.prototype, variate, { | ||
get: function () { | ||
@@ -8,0 +9,0 @@ XEAjax.$context = this |
{ | ||
"name": "vxe-ajax", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "用于 Vue 全局安装 xe-ajax", | ||
@@ -5,0 +5,0 @@ "main": "dist/vxe-ajax.common.js", |
7475
86