Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed May 23, 2020
1 parent b47b62b commit 250b10c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions dist/vxe-ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@

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 get() {
XEAjax.$context = this;
return XEAjax;
Expand Down
2 changes: 1 addition & 1 deletion dist/vxe-ajax.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
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 () {
XEAjax.$context = this
return XEAjax
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vxe-ajax",
"version": "2.1.1",
"version": "2.1.2",
"description": "用于 Vue 全局安装 xe-ajax",
"main": "dist/vxe-ajax.common.js",
"unpkg": "dist/vxe-ajax.js",
Expand Down

0 comments on commit 250b10c

Please sign in to comment.